I have a few jar files included in my application that i have added to librarys In net beans these can be read and used
I have tried to create an executable file in netbeans by Clean and build and i have all the necessary properties in build packaging set, however when i try to double click the jar created nothing happens. It is supposed to run the jar from my Main class
Now i tried to go to cmd terminal and do it from there using:
java -jar myapp.jar
I have added 3 different jars including sqlite-jdbc3.8.7, AbsoluteLayout, miglayout
but what was returned was:
Exception in thread "main" java.lang.RuntimeException: Could not load SQLite JDBC driver
at myapp.database.DatabaseConProvider.<init>(DatabaseConPr
ovider.java:18)
at myapp.presenter.AppPresenter.<init>(AppPresenter.java
:32)
at myapp.Main.main(Main.java:17)
Caused by: java.lang.ClassNotFoundException: org.sqlite.JDBC
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at myapp.database.DatabaseConProvider.<init>(DatabaseConPr
ovider.java:16)
... 2 more
The problem seems to be that its not being able to access the jar files that have been added to the project, because once I execute clean and build the /dist folder in the project only has myapp.jar but should also have README.txt and a lib folder which contains all the librarys. As seen in:
http://netbeanside61.blogspot.co.uk/2009/08/making-executable-desktop-application.html
I am using windows 8 with netbeans 8.0.2