How to get the "main" class?
Eric Caspole
eric.caspole at amd.com
Wed Mar 14 07:08:38 PDT 2012
It seems not so outlandish that most profilers/monitors/debuggers etc
would want to be able to retrieve and present this to the user of the
tool, if only so that you could monitor 2 things at once and easily
see what's what without having to look up the pid. But it sounds like
it might be done by some custom magic for each tool.
Is there any path to standardize finding the main class when using
the normal launcher? I know it would not apply the same way when
doing JNI_CreateJavaVM by hand in app code but it seems useful in
many cases.
Regards,
Eric
On Mar 14, 2012, at 6:49 AM, David Holmes wrote:
> On 14/03/2012 7:56 PM, Krystal Mok wrote:
>> That's true. I should have stated that warning beforehand.
>> It'd be better if there's a standard way of getting this information,
>> without depending on implementation-specific hacks.
>
> But as I said the whole concept of there even being a "main class"
> is a feature of the launcher. So any mechanism for retrieving it
> has to be launcher specific.
>
> David
>
>> Thanks,
>> - Kris
>>
>> On Wed, Mar 14, 2012 at 5:51 PM, Alan Bateman
>> <Alan.Bateman at oracle.com
>> <mailto:Alan.Bateman at oracle.com>> wrote:
>>
>> On 14/03/2012 04:14, Krystal Mok wrote:
>>
>> Oops, I forgot to "reply all" again...
>>
>> I would think that depending on sun.java.command is going to
>> fragile. It's unlikely to be set by custom launchers, is a
>> private
>> interface between the launcher and the VM and so could
>> disappear to
>> change at any time.
>>
>> -Alan
>>
>>
>
More information about the hotspot-runtime-dev
mailing list