0

I am currently working on creating an artificial world and I have followed the following website http://www.ethics.ubc.ca/eame/eameweb/Simulators/JavaProject/TofC.html

He used an applet to create it and have 9 classes in total.

I have done edited the coding and it works perfectly fine in Eclipse but when I try to export a .jar file its just not working.

I have tried to export it as a "Jar File" and generate a Bug.jar and I extract the file and add, in the MANIFEST.MF file:

Main-Class: Bugs.World 

Then when I double click the Bug.jar file, nothing happen.

When I try to export with "Runnable Jar File", I can't find my program under the Launch Configuration.

Can anyone help me on this please? Thanks!

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
user2008324
  • 1
  • 1
  • 3
  • 1
    http://www.ethics.ubc.ca/eame/eameweb/Simulators/JavaProject/TofC.html is a 404 here. (Not that the URL seems that relevant to the question.) – Andrew Thompson Jan 25 '13 at 00:24
  • Did you create a class with a main method like I asked you to do [on your other question](http://stackoverflow.com/questions/14506704/how-to-generate-jar-file-with-no-main-method)? – Perception Jan 25 '13 at 02:44

1 Answers1

1

Then when I double click the Bug.jar file, nothing happen.

That won't work for an applet. For more info., run it from the CLI as:

java -jar Bug.jar 

To launch an applet, it needs to be embedded in HTML or launched using Java Web Start (embedded or free floating) using a JNLP.

Community
  • 1
  • 1
Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
  • If I really need to create a Jar archive what should I do? – user2008324 Jan 25 '13 at 00:35
  • A Jar file can be embedded in HTML or launched using JWS. Almost everything that is deployed should be in a Jar. – Andrew Thompson Jan 25 '13 at 00:41
  • 1
    See also @AndrewThompson's _tag-in-source_ technique using `appletviewer`, [here](http://stackoverflow.com/a/7455045/230513) and [here](http://stackoverflow.com/a/7455066/230513). – trashgod Jan 25 '13 at 10:36