Results 1 to 8 of 8
- 05-28-2011, 05:48 PM #1
Member
- Join Date
- May 2011
- Location
- Maryland
- Posts
- 38
- Rep Power
- 0
Running a java program without eclipse / JAR Files?
I've created a java-based version of monopoly in eclipse for my computer science class that has tons of classes and images. I know how to use it in eclipse but i was wondering how to run it on another computer that doesn't have eclipse so that a friend could run it on their computer. Someone mentioned something about a JAR file, but I wasn't sure how to create one of those or if this was the right thing to do? Can anyone help?
- 05-28-2011, 07:01 PM #2
If you created a jar file with all the class files and a manifest file, you can pass that jar file to anyone with a JRE installed and it should execute.
Read the JDK doc for the jar command. jar comes with the JDK.
Also do a search on the forum for examples of jar command usages.
Also look at using Eclipse to create the jar file.
- 05-29-2011, 05:34 AM #3
Member
- Join Date
- May 2011
- Location
- Maryland
- Posts
- 38
- Rep Power
- 0
thanks, i've been looking at them a little but i'm getting a little confused as to how i create on in the first place after seeing things like
on oracle..Create jar file
jar c[v0M]f jarfile [-C dir] inputfiles [-Joption]
jar c[v0]mf manifest jarfile [-C dir] inputfiles [-Joption]
jar c[v0M] [-C dir] inputfiles [-Joption]
jar c[v0]m manifest [-C dir] inputfiles [-Joption]
- 05-29-2011, 05:41 AM #4
Member
- Join Date
- May 2011
- Location
- Maryland
- Posts
- 38
- Rep Power
- 0
Actually i was able to create one using eclipse but now when trying to run it ive gotten this error...any idea what to do?
Failed to load Main-Class manifest attribute from C:\....
- 05-29-2011, 09:12 AM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
You told the Eclipse jar wizard where it could find the file to be used for the manifest entry of your .jar file; the manifest file isn't there. Or (alternatively) you didn't put in a manifest entry in your .jar file at all. Check your .jar file with a zip utility and see what's in there.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 05-29-2011, 05:21 PM #6
Member
- Join Date
- May 2011
- Location
- Maryland
- Posts
- 38
- Rep Power
- 0
You were right, I was missing a manifest entry, it works perfectly now, thanks a lot!
-
If your problem is solved, please mark this thread as "solved" using the Thread Tools at the top.
- 05-30-2011, 06:38 PM #8
Member
- Join Date
- May 2011
- Location
- Maryland
- Posts
- 38
- Rep Power
- 0
Similar Threads
-
Running as Java Applet in eclipse
By atomant in forum New To JavaReplies: 0Last Post: 12-05-2010, 02:22 AM -
Running EXE files with Java
By linuxrockers in forum New To JavaReplies: 2Last Post: 03-23-2010, 06:10 PM -
Creating and running Java .ini files
By Camzie in forum NetBeansReplies: 4Last Post: 11-25-2009, 12:42 PM -
Running Java App From Eclipse in Different Language
By GotMals in forum EclipseReplies: 1Last Post: 05-06-2009, 06:43 PM -
Running batch files in java
By pradeesh in forum New To JavaReplies: 10Last Post: 12-04-2008, 09:26 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks