Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsTrouble exporting .jar file
https://www.eclipse.org/forums/index.php/mv/msg/368698/898984/#msg_898984
File> Export> JAR file.
I choose a name and location for the jar (same folder as src, images, etc). I then choose "Generate manifest file" and choose my main class and hit finish. I would upload some screenshots but I can't on this forum for some reason.
I get a popup saying "JAR export finished without warnings" and everything seems good. But when I try to run it, I get this error: "Could not find the main class: (class name) Program will exit"
I have searched a few forums with people having the same problem, but none of their solutions have seemed to work for me (or I am just doing something wrong). One thing I read is that it could be something with the Environment Variables path. I am aware of how to edit it, but I am not exactly sure what I would need to change (or if it even really matters). The program I am trying to export also uses images and reads info from a txt file. Not really sure if thats a big deal either. Also uses no external libraries or anything like that, just pure Java.
I have also tried exporting is as a "Runnable JAR" but I get the same error after getting the same confirmation that it compiled fine. Also, I think I should add that running the JAR or Runnable JAR through command line works fine, but I would really like to be able to distribute this to others. Also Im using Eclipse Indigo and running JDK7/JRE7
As you can probably tell I am a total n00b and if anyone can walk me through what I should do in the simplest possible way, I would really really appreciate it. Thanks people! =) ]]>Nigel Cunliffe2012-07-30T01:53:11-00:00Re: Trouble exporting .jar file
https://www.eclipse.org/forums/index.php/mv/msg/368698/899064/#msg_899064
> Hi. In the process of learning Java I have mainly been making very
> simple programs. But now I actually have a project, still in progress,
> that I am very proud of so far. Anyways I would like to export it as a
> JAR file(its a game), but I seem to be failing to do so. What I do is,
> File> Export> JAR file.
>
> I choose a name and location for the jar (same folder as src, images,
> etc). I then choose "Generate manifest file" and choose my main class
> and hit finish. I would upload some screenshots but I can't on this
> forum for some reason.
>
> I get a popup saying "JAR export finished without warnings" and
> everything seems good. But when I try to run it, I get this error:
> "Could not find the main class: (class name) Program will exit"
Make sure to run it with java[w] -jar <your JAR>
Dani
> I have searched a few forums with people having the same problem, but
> none of their solutions have seemed to work for me (or I am just doing
> something wrong). One thing I read is that it could be something with
> the Environment Variables path. I am aware of how to edit it, but I am
> not exactly sure what I would need to change (or if it even really
> matters). The program I am trying to export also uses images and reads
> info from a txt file. Not really sure if thats a big deal either. Also
> uses no external libraries or anything like that, just pure Java.
>
> I have also tried exporting is as a "Runnable JAR" but I get the same
> error after getting the same confirmation that it compiled fine. Also,
> I think I should add that running the JAR or Runnable JAR through
> command line works fine, but I would really like to be able to
> distribute this to others. Also Im using Eclipse Indigo and running
> JDK7/JRE7
>
> As you can probably tell I am a total n00b and if anyone can walk me
> through what I should do in the simplest possible way, I would really
> really appreciate it. Thanks people! =)]]>Dani Megert2012-07-30T12:22:06-00:00Re: Trouble exporting .jar file
https://www.eclipse.org/forums/index.php/mv/msg/368698/899188/#msg_899188
Nigel Cunliffe2012-07-31T00:15:37-00:00