java - Getting an executable jar file to run after creation from netbeans -


i have few jar files included in application have added librarys in net beans these can read , used

i have tried create executable file in netbeans clean , build , have necessary properties in build packaging set, when try double click jar created nothing happens. supposed run jar main class

now tried go cmd terminal , there using:

java -jar myapp.jar  

i have added 3 different jars including sqlite-jdbc3.8.7, absolutelayout, miglayout

but returned was:

exception in thread "main" java.lang.runtimeexception: not load sqlite jdbc driver         @ myapp.database.databaseconprovider.<init>(databaseconpr ovider.java:18)         @ myapp.presenter.apppresenter.<init>(apppresenter.java :32)         @ myapp.main.main(main.java:17) caused by: java.lang.classnotfoundexception: org.sqlite.jdbc         @ java.net.urlclassloader$1.run(unknown source)         @ java.net.urlclassloader$1.run(unknown source)         @ java.security.accesscontroller.doprivileged(native method)         @ java.net.urlclassloader.findclass(unknown source)         @ java.lang.classloader.loadclass(unknown source)         @ sun.misc.launcher$appclassloader.loadclass(unknown source)         @ java.lang.classloader.loadclass(unknown source)         @ java.lang.class.forname0(native method)         @ java.lang.class.forname(unknown source)         @ myapp.database.databaseconprovider.<init>(databaseconpr ovider.java:16)         ... 2 more 

the problem seems not being able access jar files have been added project, because once execute clean , build /dist folder in project has myapp.jar should have readme.txt , lib folder contains librarys. seen in:

http://netbeanside61.blogspot.co.uk/2009/08/making-executable-desktop-application.html

i using windows 8 netbeans 8.0.2

with explorer can go structure of .jar file . (or rename extension .jar .zip)

  • possibility 1
    @ manifest.mf there

manifest-version: 1.0 ant-version: apache ant 1.9.4 created-by: 1.7.0_51-b13 (oracle corporation) class-path: lib/sqlite-jdbc-3.8.7.jar x-comment: main-class added automatically build main-class: find 

here sqlite-jdbc-3.8.7.jar in lib/ folder outside guiformexamples.jar

enter image description here

  • possibility 2
    content of sqlite-jdbc-3.8.7.jar added appxx.jar

enter image description here


  • case 1
    put lib folder in same folder appxx.jar is

  • case 2 must work out of box


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -