Making a JAR file
3 posters
Page 1 of 1
Making a JAR file
1. Copy the .class files into the same folder as jar.exe (search for jar.exe to find it)
If the .class files are in a package, copy the folder with the .class files of the package, not the individual class files.
2. make two text files, "mainClass.txt" and "manifest.txt". In each file, put the text "Main-Class: " + your main class name (including package if applicable). Then press Enter to make a new line.
3. In cmd prompt, navigate to the folder with your .class files and jar.exe. Use cd foldername
4. Type (in cmd prompt) the following: "jar.exe cvfm JarName.jar manifest.txt mainClass.txt *.class"
If you have package classes in a folder, type "FolderName/*.class"
5. Type "JarName.jar" to test your jar file.
If the .class files are in a package, copy the folder with the .class files of the package, not the individual class files.
2. make two text files, "mainClass.txt" and "manifest.txt". In each file, put the text "Main-Class: " + your main class name (including package if applicable). Then press Enter to make a new line.
3. In cmd prompt, navigate to the folder with your .class files and jar.exe. Use cd foldername
4. Type (in cmd prompt) the following: "jar.exe cvfm JarName.jar manifest.txt mainClass.txt *.class"
If you have package classes in a folder, type "FolderName/*.class"
5. Type "JarName.jar" to test your jar file.
Last edited by Michael on Thu Oct 16, 2008 4:17 pm; edited 1 time in total
Re: Making a JAR file
Thanks. Came in handy for some of my programs at home @@;
Also you need to run it under administrator on Vista Computers
Also you need to run it under administrator on Vista Computers
Chii- Graduated member
- Number of posts : 1
Registration date : 2008-05-01
Re: Making a JAR file
I do it all the time, and I'm not admin...although you might need admin permission to see the files in the Program Files folder.Chii wrote:Also you need to run it under administrator on Vista Computers
Re: Making a JAR file
whats this for again?
Nameless- Member
- Number of posts : 247
Location : Unknown, but with known acceleration and direction
Registration date : 2008-08-31
Re: Making a JAR file
Ohhh do i learn this in CS1?
Nameless- Member
- Number of posts : 247
Location : Unknown, but with known acceleration and direction
Registration date : 2008-08-31
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum