Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of sun.jvm.hotspot.HelloWorld?

I just stumbled upon the class sun.jvm.hotspot.HelloWorld. The source of this class is present since Java 6. The latest version can be found here.

Does someone know the purpose of this class? Is this some kind of developer playground class while developing the JDK?

Thanks in advance!

like image 543
Martin Seeler Avatar asked Mar 31 '15 18:03

Martin Seeler


1 Answers

This file belongs to HotSpot Serviceability Agent.

Serviceability Agent is a kind of internal tool for JVM developers. It is not a part of any public standard, so it does not necessarily need to be covered by TCKs or the separate test suites, though it still has to be consistent with the actual version of HotSpot. I believe HelloWorld was used by JVM developers as a smoke test to make sure Serviceability Agent works in basic cases. So the term "playground class" as you called it fits perfectly.

Frankly speaking, Serviceability Agent source base is not maintained very clean - you may notice other leftover things there. But there is also some interesting stuff, e.g. HSDB or CLHSDB which is a tool for analysing internal structures inside a foreign JVM process.

like image 99
apangin Avatar answered Nov 07 '22 00:11

apangin