Xbooting Java类 [英] Xbooting a Java class
问题描述
基本上,我想在运行时将Canvas
类替换为使用我的自定义Canvas
类的应用程序,听说xbooting
可以做到这一点,但没有教程或任何内容.
Basically I want to replace the Canvas
class at runtime by an application that uses my custom Canvas
class, I heard xbooting
can do this but there are no tutorials or anything.
所以我只是想知道vm参数是什么,请您能帮我吗?
So I'm just wondering what the vm arguments are, can you help me please?
推荐答案
通过xboooting
您可能是指-Xbootclasspath
参数?
By xboooting
you probably mean the -Xbootclasspath
parameter?
您可以使用-Xbootclasspath
覆盖VM引导时正在加载的类.这样,您可以为VM提供您自己的特定类的实现,并且将在VM开始时立即使用它.您可以执行以下操作:
You can use the -Xbootclasspath
to override the classes that are being loaded when the VM is booting. This way you can give the VM your own implementation of a certain class and it will be used right from the start of the VM. You can do something like this:
java -Xbootclasspath/p:path_to_the_jar_with_myCanvas_class.jar HelloWorld.class
但是-Xbootclasspath
不会在运行时替换Canvas
类,替换将已经在虚拟机启动时进行.
But the -Xbootclasspath
won't replace the Canvas
class at runtime, the replacement will occur already at the start of the VM.
关于Xbootclasspath,这是一篇不错的文章:何时在HotSpot上使用-Xbootclasspath?
Here is a nice post about Xbootclasspath : When to use -Xbootclasspath on HotSpot?
这篇关于Xbooting Java类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!