问题描述
我想将一些类文件添加到 rt.jar
。我怎么能这样做?
I want to add some class files to rt.jar
. How am I able to do that?
推荐答案
你的问题表明你对java平台有一些误解。
Your question indicates you have some misunderstanding of the java platform.
首先,您需要知道rt.jar是什么以及它做什么:
First of all you need to know what the rt.jar is and what it does:
rt.jar是罐子里面包含java运行时所需的所有类。因此它的名字是 rt .jar
rt.jar is the jar that contains all the classes necessary for the java runtime. Hence it's name rt.jar
现在你知道了,你需要知道你的java程序是如何运行的:
Now that you know that, you need to know how your java program runs:
您的java程序,所有的jar和类都由java虚拟机执行。
Your java program, all your jars and classes are executed by the java virtual machine.
因为你可以看到你编写的代码&安培; java运行时使用的rt.jar是完全独立的,应保持不变。
So as you can see the code you write & the rt.jar which is used by the java run time are completely separate and should remain so.
如果你需要某些功能,你应该将它添加到jar中。
If you need some functionality you should add it to your jar.
这篇关于如何更新rt.jar文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!