Quantcast

Maximum PC

It is currently Thu Apr 17, 2014 11:00 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Compile java to .exe
PostPosted: Sat Apr 10, 2010 6:51 pm 
Northwood
Northwood
User avatar

Joined: Mon Sep 17, 2007 1:27 pm
Posts: 3311
Location: Toronto, ON
For school project, we are writing a program in Java. However we are writing with Netbeans which uses Java 1.6, but the teacher's computer only has Ready to Program which uses Java 1.4. The compile we write won't compile on the teacher's computer using Ready to Program. Is there a way to compile the Java to a .exe so it can run off of the teacher's computer without any installation?


Top
  Profile  
 
 Post subject:
PostPosted: Sat Apr 10, 2010 8:55 pm 
8086
8086

Joined: Fri Apr 09, 2010 5:11 pm
Posts: 30
http://en.wikipedia.org/wiki/Java_compiler

Which leads to, GCJ, which you can use on Windows using either Cygwin or MinGW (if you're using Linux then you should already have GCC). There may be other options, but I don't know of them.

But its a lot of work to set up and not really worth it. There is really no good reason to compile Java to native code. My recommendation is to get your teacher to update his/her Java.


Top
  Profile  
 
 Post subject:
PostPosted: Sun Apr 11, 2010 8:34 am 
Million Club - 5 Plus*
Million Club - 5 Plus*
User avatar

Joined: Sun Sep 12, 2004 6:37 pm
Posts: 4740
Location: In the monkey's litterbox
You might also look into creating a JAR archive with a manifest that sets the main class. The teacher might have the jre installed for the newer version even though the app used to compile is 1.4 based


Top
  Profile  
 
 Post subject:
PostPosted: Tue Apr 13, 2010 12:20 am 
Bitchin' Fast 3D Z8000*
Bitchin' Fast 3D Z8000*
User avatar

Joined: Tue Jun 29, 2004 11:32 pm
Posts: 2555
Location: Somewhere between compilation and linking
How frustrating! Why on earth would your teacher give a Java programming assignment, but only have a 1.4 version of the JRE?! Uh, LAME!

You could always compile down to the older version, but you'll have to forgo using all of the cool stuff in Java 5 and 6. You need to get her to upgrade. The last time I used GCJ -- it reminded me more of a problem than a solution.


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group