Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to overwrite classes from jdk?

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 ?

Example:

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.

like image 942
Marius Avatar asked Feb 25 '23 06:02

Marius


1 Answers

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

-Xbootclasspath/p:

And good luck hacking the source!!

like image 74
bestsss Avatar answered Mar 12 '23 11:03

bestsss