Xbooting Java类 [英] Xbooting a Java class

查看:113
本文介绍了Xbooting Java类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我想在运行时将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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆