如何从jdk覆盖类? [英] How to overwrite classes from jdk?

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

问题描述

我正在尝试从open jdk更改某些类,所以我要创建与open jdk类相同的包结构,并使用netbeans更改类。当我在构建项目时,如果覆盖类中出现问题,我会遇到错误。如果成功构建了我的项目,则应用程序似乎不考虑我对类的更改,而是使用打开的jdk类。知道如何使用我的类而不是openjdk的类吗?

I'm trying to change some classes from open jdk, so I'm creating the same package structure as the open jdk classes have and I'm changing the classes using netbeans. When i'm building the project if something is wrong in the overwritten classes i'm getting an error. If a successfully build my project it seems like the changes from my classes are not considered by the application, the open jdk classes are used instead. Any idea how can I use my classes and not the ones from openjdk ?

示例:

如果我创建我的项目中的类 sun.net.www.protocol.https.HttpsURLConnectionImpl ,我对其进行了一些更改,因此构建了该项目,但是当我运行他的应用程序时,我的更改不会出现,例如

if i create the class sun.net.www.protocol.https.HttpsURLConnectionImpl in my project and I do some changes in it, I build the project, but when I run he application my changes do not appear, like the original class from openjdk is used, not my class.

推荐答案

您需要更改引导程序类路径java -X以获得更多信息,

you need to change the bootstrap classpath java -X for more info, here is just the option you need exactly.

-Xbootclasspath / p:

祝您好运!

这篇关于如何从jdk覆盖类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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