Results 1 to 5 of 5
Thread: How do I export to a Jar?
- 11-14-2010, 04:04 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
[SOLVED]How do I export to a Jar?
I have created a game for fun, and I'm having trouble exporting it to a jar file so I can place it on a webpage.
It runs perfectly in eclipse however, on a webpage the jar file sits there with the Java logo waiting it load, which it never does.
So I'm not sure if I should use just class files to place on the webpage.
However, when I try to use the applet tag with code="Game.class" it only draws a black screen with none of the things from my other classes being loaded. So I'm not sure whether Eclipse is messed up, or if I don't know anything at all(Which is most likely the case).
So can anyone help me seal my game into a jar? Or just get it on a blank HTML document for that matter.
It can be found here:
http://zrev.net/java.zip
Thanks,
BreadLast edited by Bread; 11-15-2010 at 12:03 AM.
-
Your best bet is to create smaller experimental jars to test sub-portions of your program to find out just where the problem is -- to trouble shoot, and then when found, to post this small program here.
My guess is that you're trying to treat resources such as images as if they were files, which may work in Eclipse but not in the Jar where you have to treat them as resources. If you use images or obtain files, try a simpler version of your program without this functionality just to see if it works.
Luck!
- 11-14-2010, 07:20 PM #3
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
It worked perfectly, thank you very much! I replaced all the images with drawRect and it worked just the way it needs to.
How would I go about adding images since it didn't work?
Thanks again,
Bread
-
Use the ImageIO.read(InputStream input) method, and get your images not as files, but as resources via class's getResourceAsStream(...) method.
- 11-15-2010, 12:03 AM #5
Member
- Join Date
- Nov 2010
- Posts
- 4
- Rep Power
- 0
Similar Threads
-
Export data to xls
By trill in forum Advanced JavaReplies: 5Last Post: 03-24-2011, 05:13 AM -
export to xml
By karq in forum Advanced JavaReplies: 0Last Post: 10-01-2010, 10:49 AM -
export eps
By mr_empty in forum Java 2DReplies: 0Last Post: 04-25-2010, 08:40 AM -
Export jtable to csv
By anilkumar_vist in forum New To JavaReplies: 1Last Post: 02-08-2010, 07:25 AM -
Export to excel
By nehaa in forum AWT / SwingReplies: 1Last Post: 04-30-2009, 02:44 PM


LinkBack URL
About LinkBacks

Bookmarks