How to recompile Java Runtime Environment (JRE)?

I thought it would be very easy. I downloaded the JDK, extracted src.zip, modified the JDK to fit my needs and saved the file.

Now the only thing I need to do is recompile the extracted and updated src folder to "JRE". I tried to use javac but I won’t go anywhere. For example, I received an error that the source files were not specified. I obviously do not use the correct syntax to compile the JRE.

So, can someone tell me how you end up working with the JRE working folder containing the modified Java Runtime Environment based on the new source folder extracted from the JDK?

Note. I am not going to redistribute the compilation. It is intended for personal use only.

Update: thanks to the answer and http://www.javalobby.org/java/forums/t103334.html I got the following command: "c:\tmp\jdk1.6.0_17\bin\javac" -classpath "c:\tmp\out" -verbose -g -d "c:\tmp\out" -J-Xmx512m -cp "c:\jdk1.6.0_17\jre\lib\rt.jar";"c:\jdk1.6.0_17\lib\tools.jar" @files.txt- unfortunately, it seems to handle things when the output folder has finished / the output is empty. Is there something wrong with my team?

Thanks in advance.

+3
source share
6 answers

Set your path to the top of the extraction source directory. Compile the files, then put their .class files back into rt.jar.

+2
source

Sun/Oracle JDK , , , com.sun.* , , - JDK. OpenJDK ( , ). - , , , , JDK.

+2
  

, , .

  

javac .java , . javac , .

+1

OpenJDK, IcedTea ( OpenJDK IcedTea).

+1

Sun:

Java. , , , , - "java", "javax", " , Sun, .

, JVM . , Sun .

EDIT: @ ; Sun "vanilla" JRE, , .

0

"c:\tmp\jdk1.6.0_17\bin\javac" -classpath "c:\tmp\out" -verbose -g -d "c:\tmp\out" -J-Xmx512m -cp 

:

set path=C:\tmp\jdk1.6.0_17\bin

,

C:\tmp>set classpath=.

C:\tmp>javac YourProgramName.java

C:\tmp>java YourProgramName
0

Source: https://habr.com/ru/post/1735484/


All Articles