No Netbeans works, no Jar

1

I know you have some similar topics, but none answers my question.

I created a program to insert information into the database and it works perfectly when I send netbeans to compile.

I made Jar, and when I use the program from Jar, nothing is inserted into the database (MYSQL).

I do not understand why this is happening.

    
asked by anonymous 15.03.2017 / 05:23

2 answers

1

A command used to execute an executable class that was set as the project default (which was set to default will be executed in case of having more than one executable class within the same jar) is as follows:

java -jar filename.jar

As the author of the question noted, if this project does not have all the built-in dependencies, it will need to reference where the dependencies are on the machine.

One utility of executable .jar files is to call them via cron to perform system maintenance tasks, such as generating daily reports, etc.

    
16.03.2017 / 02:48
0

I was able to solve this problem, so I'll leave it here if someone else has this problem too.

This happened because I was using JAR out of the dist folder, and thus I lost the connection to the MYSQL database because I used an external jar for MYSQL connection.

    
16.03.2017 / 02:27