如何重新编译Java运行时环境(JRE)?(How to recompile Java Runtime Environment (JRE)?)

编程入门 行业动态 更新时间:2024-10-21 04:01:17
如何重新编译Java运行时环境(JRE)?(How to recompile Java Runtime Environment (JRE)?)

我觉得这很容易。 我下载了JDK,解压缩了src.zip,修改了JDK以满足我的需求并保存了文件。

现在,我唯一需要做的就是将提取的和更新的src文件夹重新编译为“JRE”。 我尝试使用javac,但没有得到任何结果。 例如,我得到的错误是没有给出源文件。 我很明显没有使用正确的语法来编译JRE。

那么,任何人都可以告诉我,你如何最终得到一个工作的“JRE”文件夹,其中包含一个基于从JDK中提取的新源文件夹的修改过的Java Runtime Environment?

注意:我不打算重新分发编译。 仅供个人自用。

更新:感谢答案和http://www.javalobby.org/java/forums/t103334.html我得到以下命令: "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 - 遗憾的是,虽然它确实处理了事情,但完成后输出文件夹/ out为空。 我的命令有问题吗?

提前致谢。

I thought this 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 update src folder to a "JRE". I tried using javac, but didn't get anywhere. For example, I got the error that no source files were given. I am obviousely not using the right syntax to compile the JRE.

So, can anyone tell me, how do you end up with a working "JRE" folder containing a 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 for personal self use only.

Update: thanks to an answer and http://www.javalobby.org/java/forums/t103334.html I got to 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, while it does seem to process things, when finished the output folder /out is empty. Is something wrong with my command?

Thanks in advance.

最满意答案

将类路径设置为提取源目录的顶部。 编译文件,然后将他们的.class文件放回rt.jar。

Set your classpath to the top of the extract source directory. Compile the files then place their .class files back in the rt.jar.

更多推荐

本文发布于:2023-07-07 21:38:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1068511.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:环境   JRE   Java   Environment   Runtime

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!