Computer Science Canada

Compiling a Java Game

Author:  josh [ Fri Oct 01, 2004 1:44 pm ]
Post subject:  Compiling a Java Game

I know this is a really stupid question but over the summer I wrote my own version of asteroids and I can't figure out were the option is in the compiler I am using (Eclipse) to compile it into an HTML file so I can post it on compsci or other sites.

Also their are alot of immages in the game so does n e 1 have a good idea on how to compress them (I tried winzip but it didn't make it much smaller)

Thanx
rhysticlight

Author:  wtd [ Fri Oct 01, 2004 1:55 pm ]
Post subject: 

If it's an applet, then you should just be able to compile it normally. You then include HTML code which calls that ".class" file.

It's been a while since I've dealt with applets so I can't be more helpful, unfortunately.

Author:  josh [ Fri Oct 01, 2004 1:57 pm ]
Post subject: 

its o.k. but I don't even know how to comopuile it normally.

this is my first finished Java projet taht I actually want to post. Embarassed

Author:  wtd [ Fri Oct 01, 2004 2:02 pm ]
Post subject: 

Use "javac" at the command line. The general format is:

code:
C:\> javac MyClass.java


Which, if compilation is successful, creates MyClass.class.

That said, if you've never seen the Java compiler before, and you're trying to do this, you may want to start out a bit more gently.

Just remember, if the compiler throws a horrendous number of errors, fix the first one first!

Author:  josh [ Fri Oct 01, 2004 2:06 pm ]
Post subject: 

I have never used the commadn line compiler. Always used the Eclipse IDE.

Author:  wtd [ Fri Oct 01, 2004 2:07 pm ]
Post subject: 

The command-line compiler works, and it's simpler.

That said, if you have compiled your project before, then it's just a matter of writing the HTML to use it.

Google is your friend. Smile

Author:  josh [ Fri Oct 01, 2004 2:10 pm ]
Post subject: 

kk tahnx I will try it when i get home.

I do I need to type in any directores firs after I open the cmd ???

Author:  wtd [ Fri Oct 01, 2004 2:12 pm ]
Post subject: 

rhysticlight wrote:
I do I need to type in any directores firs after I open the cmd ???


Yeah, you do, but I didn't know what they'd be in your case, so I figured it'd be better not to guess. Smile

Author:  josh [ Fri Oct 01, 2004 2:15 pm ]
Post subject: 

kk thanx I will figure it out.


: