Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one build the java JRE from source (src.zip in JDK)?

Surprisingly enough I couldn't find the answer to this question.

I am trying to rebuild the java JRE from source. I obtain the java JRE source by extracting the src.zip file in the JDK.

After making any changes I need to make to the JRE, how do I compile the new source back into .java files (after which I can compress it into the rt.jar file).

Thanks.

like image 216
Tom Avatar asked Feb 09 '11 18:02

Tom


2 Answers

You have better chances using OpenJDK (the base of Oracle/ Sun's future JDKs). http://openjdk.java.net/

But what do you want to change actually? Maybe there is a better way...

like image 135
Puce Avatar answered Oct 21 '22 21:10

Puce


Some of the Java sources that make up rt.jar are generated during the build process, from scripts and other means. Some of the properties files are also generated this way, and some of the properties files are turned into Java source that also contributes to rt.jar. So without doing a complete build first and populating the 'gensrc' directory, you won't have all the sources that make up rt.jar.

Taken from: http://www.java.net/forum/topic/jdk/java-se-snapshots-project-feedback/it-possible-just-build-rtjar

So when you say javac on all the java files inside src.zip it won't compile as the dependency graph is broken (missing generated files)

Also have a look at this: Where to get full source code for rt.jar?

like image 33
Favonius Avatar answered Oct 21 '22 22:10

Favonius