I'm trying to find a java compiler that I can use to compile my java code into native binaries on different operating systems. I have heard of the GNU Compiler for Java but I can't seem to find a download for that and I think it's dead anyway. Are there any good up-to-date compilers out there that I can use to compile java code into a .exe and a .app or anything or can you tell me how to get the GNU Compiler for Java.
Asked
Active
Viewed 1.7k times
10
-
1Why do you want to do this - what problem do you hope to solve? – Jesper May 03 '13 at 14:01
-
Also can you tell me how I can improve on asking these questions I'm a little bit new to this website and I'm not very good at asking questions. – kzolp67 May 03 '13 at 14:01
-
To keep my programs as closed source as possible – kzolp67 May 03 '13 at 14:01
-
You could use an obfuscator such as [ProGuard](http://proguard.sourceforge.net/) to make it harder to decompile your code. – Jesper May 03 '13 at 14:02
-
Yes but that still doesn't keep it as closed source as I'd like – kzolp67 May 03 '13 at 14:03
-
1This Question lists some alternatives: http://stackoverflow.com/questions/4035538/is-gnus-java-compiler-gcj-dead – Stephen C May 03 '13 at 14:03
-
I also want to try just for the point of trying to do it – kzolp67 May 03 '13 at 14:03
-
2Closed source is about licensing ... not about whether people can reverse engineer your code. – Stephen C May 03 '13 at 14:05
-
It's for personal use and for sharing with my friends. I just want to give it a go. – kzolp67 May 03 '13 at 14:06
-
An alternative might be a **code obfuscator** mangling the java names and such. – Joop Eggen May 03 '13 at 16:24
-
http://stackoverflow.com/questions/4019724/free-aot-java-compiler – Ciro Santilli OurBigBook.com Sep 06 '16 at 07:40
2 Answers
5
GNU Compiler for the Java can be found at http://gcc.gnu.org/install/binaries.html
And you may try the following tools:

zhuwenger
- 111
- 4
-1
gcj is a part of gcc.
Although judging by it's support for "some 1.5 additions" it is out of date. Why are you bothering though? You can setup an installer that updates the jre instead.

axle_h
- 553
- 1
- 5
- 16
-
1What do you mean you can setup an installer that updates the jre instead. – kzolp67 May 03 '13 at 14:16
-
-
launch4j only wraps the jar in an exe it is still extractable to a normal jar – kzolp67 May 03 '13 at 14:22
-
2I know, I was stating that something like launch4j would be a better option than native compiling. If you absolutely have to have native code then develop using c++. Java wasn't made for it. – axle_h May 03 '13 at 14:42