Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instrumenting java core libraries

Tags:

java

When we compile a java program, we get .class files. Can I access these .class files of java core libraries? e.g. can I have access to java.lang.String.class ?

Actually I am doing a research and trying to find branch coverage of some java core libraries. The tool I am using for branch coverage actually instruments the .class files.

Thanks

like image 527
neebz Avatar asked Dec 18 '25 18:12

neebz


1 Answers

It's in rt.jar in your JRE directory. You've even got the sources in src.zip. (Or you could just pull the latest version of OpenJDK.)

Also, if you want to instrument the base classes, you'll also need to specify a boot classpath. Look at the -Xbootclasspath option for java: http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html

like image 87
gustafc Avatar answered Dec 20 '25 08:12

gustafc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!