creating jar file for application which in turn contains external jar file
Hie all ,
I want to create an jar file for a java application, a开发者_运维技巧nd i am able create the jar file for it properly.i followed the below link to create the jar file .enter link description here
But the problem what i am facing is that in my application i added the external jar's like jna.jar , platform.jar and vlcj-1.2.0-javadoc.jar files to run my application successful. This application will run fine when i run in eclipse , but when i create the far file for the same application I'm getting the error like No class defination found error. jna native library missing.
so please will you tell me what is the actual problem and how do I solve it . and one more thing while creating the jar file I enabled the option "Export java source files and resources".
thanks in advance Datta
You have to supply full class path when you are running your application, i.e. something like:
java -cp myapp.jar;jna.jar;platform.jar com.mycompany.MyMain
If you are using -jar option you should put all third party libraries to manifest.mf packaged into your jar under META-INF, i.e. add line like:
Class-Path: jna.jar platform.jar
to you manifest.
Pay attenition that you should use ; for windows command line, : for unix command line and space when writing class path in manifest.
精彩评论