|
Re: Unable to Create Working .jar [message #846044 is a reply to message #845886] |
Sun, 15 April 2012 17:54 |
|
On 2012.04.15 8:13, Andrew Barrell wrote:
> I have finally finished a project I've been working on for a couple of days and when trying to export it into a executable .jar file it doesn't work how it is supposed to (the frame is black as it is supposed to be, however the yellow ball does not appear as it does when running it from inside eclipse).
>
> Could you please help me in figuring out what I am doing wrong? I have toyed around with it for an hour and searched youtube and other forums for the solution to no avail.
>
> I will attach the image used and the two .java classes to this thread to allow someone to check if the layout is correct. To add the image I right clicked on the project, -> Add New File. Renamed it ballImage and put the image called "ball.png" into it.
>
> I use Eclipse Indigo.
>
> Thank you,
> ~Andrew
The problem's not going to be in the source files themselves, but in
your creating a proper JAR including them and the AWT and other
libraries on which they depend.
|
|
|
|
Re: Unable to Create Working .jar [message #846249 is a reply to message #846052] |
Sun, 15 April 2012 22:59 |
|
On 2012.04.15 12:07, Andrew Barrell wrote:
> I'm quite new to all of this to be honest but I followed some tutorials
> on youtube to a tee and they still didn't solve it. When I extracted the
> .jar it had all the files (seemingly) in the .jar so I don't understand
> why its not working out. Do you have any idea how I can fix it, or what
> I can do different, what options I'm not selecting etc
>
> ~Andrew
You can either embed the supporting JARs in the JAR you generate, or
reference the class path to the additional JARs you need on the command
line:
$ java -classpath "libs/:" YourApplication.jar
I assume that in YourApplication.jar you've got all three files where
they need to be since you used Eclipse Export... to create it.
|
|
|
Powered by
FUDForum. Page generated in 0.10296 seconds