Java Compiler?

elbirth

Member
May 8, 2003
156
0
0
I don't do programming (I started doing Java in college and my professor taught it in such a screwed up manner myself and about a dozen other people were completely lost so some of us dropped it rather than fail it).
Anyway, a friend of mine is looking for a java compiler (and I'd like to use it later when I take the time to learn it on my own)... something like Visual J++. He had been using that, but now he wants to use java 1.4, but since J++ only uses the Java VM, it doesn't seem to have the latest 1.4 version of Java... at least that he can find.

He wants to either be able to find a way to make J++ use Java 1.4, or find an alternative (preferably open source if possible) that can compile the code and also be able to create a Windows .exe file like J++ can.

Anyone know of a program like this?

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
MS Java VM is no longer, Sun sued them because it wasn't conforming to the standard and Sun won. J++ is really old and shouldn't be used for anything.

I don't think anything will create a .exe from java classes because that would defeat one of the main selling points of java, i.e. portability. What's wrong with using a batch file to run the thing after it's done?
 

TerryMathews

Lifer
Oct 9, 1999
11,464
2
0
Believe it or not, there are ways to compile the java byte-code into platform-specific binaries, and the performance is competitive with C++.

To answer the original question, however, Borland makes a pretty nice (commerical) Java suite in the form of JBuilder. Of course, the best cheap solution is straight from the horse's mouth: Java 1.4.2 SDK
 

thornc

Golden Member
Nov 29, 2000
1,011
0
0
Borland's JBuilder Personal is free for non-commercial use!
I know I have it, it's very good!

Terry, can you give us some links where we can find some examples on how to compile to native binaries??
 

manly

Lifer
Jan 25, 2000
13,590
4,239
136
Originally posted by: Nothinman
MS Java VM is no longer, Sun sued them because it wasn't conforming to the standard and Sun won. J++ is really old and shouldn't be used for anything.

I don't think anything will create a .exe from java classes because that would defeat one of the main selling points of java, i.e. portability. What's wrong with using a batch file to run the thing after it's done?
There are a variety of solutions for creating a native Java application driver. The script or batch file is the de facto standard bootstrap mechanism for Java client apps.

As for the problem with this standard, it's kind of the old UNIX way. The end result is that the typical Java app doesn't integrate as nicely with the host OS as a typical native app. We're talking simple drawbacks such as no app icon (by default) or obvious inclusion in the process list (besides java.exe), none of which are show-stoppers.

As for native compilers, they exist and have for years, but they are very much a non-starter for the Java platform. Generally, they've always lagged behind the standard Java release significantly. More importantly, most of the performance gains of static Java compilation are considered to be in the past. The 1.4 VM release is still not a speed demon, but it has largely obsoleted the Java static compilers (I'm sure some GCJ advocates would disagree vehemently). In theory, a JIT can perform closely to statically-compiled object code if the JIT overhead can be overcome by improved opportunities for dynamic optimization. In practice, it's not quite this ideal because static optimization has been researched for decades, but with every release JIT compilation gets closer.

As for an IDE, Eclipse seems to be popular (search the forums for "Java" to find additional discussion):
http://www.eclipse.org

There's also a distinction between true static compilers vs. small native apps that call the Java VM. I think Borland JBuilder will do the latter, but the benefit of such an approach is questionable. I simply don't remember at this hour, but I'd guess that J++ also does the latter.
 

elbirth

Member
May 8, 2003
156
0
0
Thanks alot for all of the input. He currently uses (and I did at when I tried taking a class before dropping) JBuilder. We have a license we can use for the course, but it expires after about a year I think, so he'd have to get the full licensed version to continue using later.

I'm not exactly sure what he meant by wanting to be able to compile it directly to a .exe, that's just what he had told me.. perhaps he meant something else and said it wrong, I'm not sure.

Anyway, I'll relay the info you all have given me. Thanks again!
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I'm not exactly sure what he meant by wanting to be able to compile it directly to a .exe, that's just what he had told me.. perhaps he meant something else and said it wrong, I'm not sure.

You're probably right, that's probably what he wants to do. I personally think it's stupid, but that's just me.