F
farsight
Hi, i'm having some problems making a runnable JAR file, and I wasn't
sure where to turn. These are my first steps in Java, so bear with me.
Basically, in the class which holds the main body of the code I have
'extended Applet implements runnable', in my init() method I create
the new thread, and in the run() method I go through an infinite loop
inside which game events happen. When I run the class with eclipse
everything works fine, and I can play through my (terrible) pong game
with no problems.
Obviously the problem here is that there is no main() method in my
program, and there doesn't seem to be space for one. Simply adding and
empty main() method to my SimplePong class lets eclipse export the
project to a .jar file, but the program still can't be run.
Confusingly, eclipse will still run the project regardless of the
inclusion of the main() method.
If anyone could give me some pointers as to what I should put in there
to make the program run correctly, that would be really helpful.
Thanks.
sure where to turn. These are my first steps in Java, so bear with me.
Basically, in the class which holds the main body of the code I have
'extended Applet implements runnable', in my init() method I create
the new thread, and in the run() method I go through an infinite loop
inside which game events happen. When I run the class with eclipse
everything works fine, and I can play through my (terrible) pong game
with no problems.
Obviously the problem here is that there is no main() method in my
program, and there doesn't seem to be space for one. Simply adding and
empty main() method to my SimplePong class lets eclipse export the
project to a .jar file, but the program still can't be run.
Confusingly, eclipse will still run the project regardless of the
inclusion of the main() method.
If anyone could give me some pointers as to what I should put in there
to make the program run correctly, that would be really helpful.
Thanks.