1. Create the MANIFEST.MF file. Add the Main-Class in the manifest file:
Main-Class: Main
2. Create the jar file
jar cvfm factor.jar MANIFEST.MF *.class com gnu
3. Execute the Main class from the executable jar
java -Xms512m -Xmx512m factor.jar
Note: The Class-Path: entry doesn't work, at least in jdk 1.4 as expected i.e. it doesn't load the jar file into the classpath. The Class-Path only inform the java command to search the libraries in the relative location from the current directory. So if the jar files can be found in the location mentioned in the Class-Path: entry, then it works
No comments:
Post a Comment