简体   繁体   中英

Can I compile java myself?

Is they say that sun's java is opensource now - then can I compile all the patform from sources ?

I used gentoo and I found a great performance inmrovement wnen I compiled the system myself, so can it be done with java (both vm runtime and library classes ) ?

Is it possible to do under windows/linux ?

Did anyone do it ?

Does it make any sense ?

Yes you can. Prebuilt binaries, source code etc. are available in the OpenJDK project from Sun:

http://openjdk.java.net/

Whether it makes a difference to performance is hard to tell. It might, but usually the difference is not great.

yes, that should be possible now -- and no, it will not give you any benefits unless you have a compiler that produces better byte code from the same source input. Given the simple nature of translating java to bytecode and the fact that most optimizations are done at runtime, that seems unlikely.

Yes it's possible. If you check repositories for your linux distribution you will notice there is usually the option for OpenJDK. Everything you're after can be found on http://openjdk.java.net/ .

I am not quite sure why you would want to do this, other than for educational purposes.

Sun put quite a lot of effort in performance improvements in all aspects (JVM as well as default libs) and I see no reason why you would get it better.

Again, it's nice to know how to do it, but I wouldn't expect huge performance improvements.

我会开始在这里寻找你的java jdk源代码。

Java compiles the programs to machine code, and from what I have gathered at the Sun web site, it is quite sensitive to which compiler is used. Hence you need to use a supported build environment to be certain that the result is 100% correct.

Building the JDK is NOT easy for the uninitiated so unless you feel at home reading Makefiles I would leave this project for later :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM