Hi ,
I have created a java application in eclipse. My application uses some classes present in jar files. When I run my program, eclipse sets the classpath to point to these jar files.One of these files is classes12.zip that contains the oracle driver.My application works fine when I run it in eclipse however the problem arises when I try to distribute my application.
To distribute a java application I created a jar file using eclipse. When I ran my application from the command line I got a message that looked something like
oracle/jdbc/Driver class not found.(I am not sure of the exact error msg) but it occurs when I try to create the oracle driver.
When I checked the content of the jar file it doesnt contain the class file the program is looking for.
-For my application to work I could also manually set my java classpath to point to the classes12.zip file
However I really don't want to do this because I don't want to set the classpath manually on each of the users computers to point to the jar files.
I tried jaring the application manually so that I can just package the other libraries that I use into one big jar file. This is what I did
jar mcf Manifest.mf myJarFile classes12.zip fop.zip report.jar
The manifest.mf file contains
Main-Class: ReportGenerator (with a new line at the end)
ReportGenerator is my main class and its inside report.jar.
-classes12.zip,fop.zip contain some classes that my application uses.
When I double click the jar file that I created it says something like can't find the main class. I am wondering whether this is because the main class is inside a jar file WITHIN the main jar file.
Are there any other ways around this.I want to get all the libraries that I use into one big jar file so I don't have to set the classpath to point to these files.
Any help is greatly appreciated.
sync123
I have created a java application in eclipse. My application uses some classes present in jar files. When I run my program, eclipse sets the classpath to point to these jar files.One of these files is classes12.zip that contains the oracle driver.My application works fine when I run it in eclipse however the problem arises when I try to distribute my application.
To distribute a java application I created a jar file using eclipse. When I ran my application from the command line I got a message that looked something like
oracle/jdbc/Driver class not found.(I am not sure of the exact error msg) but it occurs when I try to create the oracle driver.
When I checked the content of the jar file it doesnt contain the class file the program is looking for.
-For my application to work I could also manually set my java classpath to point to the classes12.zip file
However I really don't want to do this because I don't want to set the classpath manually on each of the users computers to point to the jar files.
I tried jaring the application manually so that I can just package the other libraries that I use into one big jar file. This is what I did
jar mcf Manifest.mf myJarFile classes12.zip fop.zip report.jar
The manifest.mf file contains
Main-Class: ReportGenerator (with a new line at the end)
ReportGenerator is my main class and its inside report.jar.
-classes12.zip,fop.zip contain some classes that my application uses.
When I double click the jar file that I created it says something like can't find the main class. I am wondering whether this is because the main class is inside a jar file WITHIN the main jar file.
Are there any other ways around this.I want to get all the libraries that I use into one big jar file so I don't have to set the classpath to point to these files.
Any help is greatly appreciated.
sync123