Eclipse Packaging uses the MySQL database of the Jar,jar cannot connect to the database on the workaround

Source: Internet
Author: User

Landlord is a novice, followed by a textbook to write a small chat software with the database, and finally finished, in the use of Eclipse to build the jar, but always connect not MySQL, online Baidu visit the forum found that the eclipse's own export can not be packaged with third-party jar, So I began to toss ....


===========================================================

1. Download Fatjar Widget

This is a very convenient package of small plug-ins, specific download installation, please Baidu, in addition to the 4.4 version of Eclipse, the other version of Eclipse can go to the official website of the link to download, thank you for the three brother of the 4.4 version of the Fatjar

Official Portal:

sourceforge.net/projects/fjep/files/

4.4 Version Portal:

http://www.oschina.net/code/snippet_570396_36930

2. Add a MySQL jar

After installing the Fatjar, you need to add the third-party jar that you want to add, note, not in Eclipse can run, even if added, the landlord before the same thought, the results of a toss of the afternoon also did not result (the principle of what, I do not know), methods such as (Steal a picture, Don't blame It): Right click on the item you want to process = "Build Path =" ADD external archive, and then find your database connection jar, open it.

3. Packaging with the Fatjar plugin

Specific methods and Baidu experience are the same, choose a name, Next,next ... But in the filelist step finally appeared mysql-connector!!!!!!!

4. Run the jar

Finally, we can connect the database normally.!!!!!


==============================================================

Purely individual self-study opinion, the opinion is wrong, do not blame, want to quote, casual ~ ~ can solve the problem just fine!


Eclipse Packaging uses the MySQL database of the Jar,jar cannot connect to the database on the workaround

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.