JavaFX application features not working when exporting to Executable Jar file

129
March 22, 2018, at 10:55 AM

I have created a JavaFX application using to connect to a MySQL db using JDBC. Everything works perfect in eclipse, I am able to connect to my db using JDBC and perform insert update and select query's when I run my project in Eclipse. But, when I create an executable Jar file (file>export>Runnable JAR file) the db does not seem to connect or perform any of my query's.

Does anyone know how to fix this issue or if there is another way to export the project that will make it run correctly?

UPDATE: When exporting I needed to "Package required libraries into JAR" instead of "Extract required libraries into JAR", simple mistake

Answer 1

First of all you should make a library file for the jdbc you are using on your Project File
Example

Second, you should apply the libray by right clicking on your project file on the eclipse and click Properties
Click on this

And then apply the Library you needed.

Lastly dont forget to build the library along with the jar you are exporting by doing this on the export option

I Hope this helps! Cheers!

Rent Charter Buses Company
READ ALSO
Search All Fields In All Tables For A Specific Value (Oracle)

Search All Fields In All Tables For A Specific Value (Oracle)

Is it possible to search every field of every table for a particular value in Oracle?

177
Query for daily amount outstanding on all active loans

Query for daily amount outstanding on all active loans

Suppose i have a single table that contains a history of loans made to clients with the columns:

127
Spring Cannot add foreign key constraint @ManyToOne

Spring Cannot add foreign key constraint @ManyToOne

I've tried to make this Entity:

168