Making a JAR file

Post new topic   Reply to topic

View previous topic View next topic Go down

Making a JAR file

Post by Michael on Thu May 29, 2008 11:38 am

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.


Last edited by Michael on Thu Oct 16, 2008 3:17 pm; edited 1 time in total

Michael
Graduated member
Graduated member

Male Number of posts: 151
Age: 18
Registration date: 2008-04-30

View user profile http://elkinschess.forummotion.com

Back to top Go down

Re: Making a JAR file

Post by Chii on Thu Jun 19, 2008 8:24 pm

Thanks. Came in handy for some of my programs at home @@;

Also you need to run it under administrator on Vista Computers

Chii
Graduated member
Graduated member

Number of posts: 1
Registration date: 2008-05-01

View user profile

Back to top Go down

Re: Making a JAR file

Post by Michael on Sun Jun 22, 2008 8:05 pm

Chii wrote:Also you need to run it under administrator on Vista Computers

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.

Michael
Graduated member
Graduated member

Male Number of posts: 151
Age: 18
Registration date: 2008-04-30

View user profile http://elkinschess.forummotion.com

Back to top Go down

Re: Making a JAR file

Post by Nameless on Sat Sep 20, 2008 3:32 pm

whats this for again?

Nameless
Member
Member

Male Number of posts: 247
Location: Unknown, but with known acceleration and direction
Registration date: 2008-09-01

View user profile

Back to top Go down

Re: Making a JAR file

Post by Michael on Sat Sep 20, 2008 8:58 pm

a jar file encloses .class files in an executable archive.

_________________
Webmaster 08-09

Elkins Chess Club Website

Michael
Graduated member
Graduated member

Male Number of posts: 151
Age: 18
Registration date: 2008-04-30

View user profile http://elkinschess.forummotion.com

Back to top Go down

Re: Making a JAR file

Post by Nameless on Sat Sep 20, 2008 10:16 pm

Ohhh do i learn this in CS1?

Nameless
Member
Member

Male Number of posts: 247
Location: Unknown, but with known acceleration and direction
Registration date: 2008-09-01

View user profile

Back to top Go down

View previous topic View next topic Back to top


Permissions of this forum:
You cannot reply to topics in this forum