Results 1 to 8 of 8
- 12-22-2010, 07:18 PM #1
Member
- Join Date
- Dec 2010
- Posts
- 11
- Rep Power
- 0
How to create an executable jar file?
Ok so I've made a game on Java and I want to create a jar file to run it so I can just have it on my flash drive and use it on any computer that has java installed.
However I'm having trouble with it. I've googled it and found instruction around that say to type something like this "jar -cf myfile.jar *.class" but where do I type that and is there an easier way to go about creating an executable jar file?
- 12-22-2010, 07:25 PM #2
You type that into the command prompt. Google is your friend.
- 12-22-2010, 07:48 PM #3
Member
- Join Date
- Dec 2010
- Posts
- 11
- Rep Power
- 0
I did google it. However I didn't understand what to type it into it and I was wondering (hoping) there was an easier solution to it.
- 12-22-2010, 07:59 PM #4
Member
- Join Date
- Dec 2010
- Posts
- 11
- Rep Power
- 0
Whenever I try to use that command on the command prompt in the directory of my program I get the following error.
" 'jar' is not recognized as an internal or external command, operable program or batch file"
- 12-23-2010, 12:38 AM #5
Senior Member
- Join Date
- Apr 2010
- Location
- Philippines
- Posts
- 580
- Rep Power
- 4
It is either you set the path in environment variable or locate the bin folder or the javac.exe
- 12-23-2010, 09:28 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
How did you compile your code?
Because if you're getting that error on your command line then I can't see how javac could have worked.
- 12-23-2010, 03:36 PM #7
Member
- Join Date
- Dec 2010
- Posts
- 11
- Rep Power
- 0
I just used jar -cf tictactoe.jar * in the command prompt in the directory of all my class files
then I got the error
- 12-23-2010, 03:42 PM #8
The question is: how do you compile your .java files into .class files in the first place?
Because it doesn't make a ton of sense for you to be able to compile but not create a jar- if your system knows where javac is, it should know where jar is (they're in the same place).
Similar Threads
-
Create Executable Jar file
By sarwar1234 in forum New To JavaReplies: 11Last Post: 10-28-2010, 12:26 PM -
Create Executable Jar file
By sarwar1234 in forum New To JavaReplies: 3Last Post: 09-27-2010, 05:10 PM -
Executable jar file
By franklyn@bellsouth.net in forum New To JavaReplies: 12Last Post: 08-26-2010, 01:03 PM -
How to create java executable file through CMD
By Riaz Ali in forum New To JavaReplies: 4Last Post: 08-03-2010, 08:20 AM -
Create Executable problem
By castiel in forum New To JavaReplies: 13Last Post: 02-24-2010, 03:04 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks