Can I find out if the java program was launched using java or javaw

Posted by saugata on Stack Overflow See other posts from Stack Overflow or by saugata
Published on 2010-03-18T10:34:21Z Indexed on 2010/03/18 10:51 UTC
Read the original article Hit count: 233

Filed under:
|
|

This is related to an earlier question by a different user How to detect that code is running inside eclipse IDE

I noticed that eclipse always launches programs with javaw rather than java. (This does not imply a program launched with javaw was launched from eclipse).

I can find the arguments passed using

    RuntimeMXBean RuntimemxBean = ManagementFactory.getRuntimeMXBean();
    List<String> lst=RuntimemxBean.getInputArguments();
    for(int i=0;i<lst.size();i++)
        System.out.println(lst.get(i));

But this does not tell me whether it was launched using java or javaw. Is there any way to find it out? Another related question is why does eclipse use javaw to launch programs?

© Stack Overflow or respective owner

Related posts about java

Related posts about javaw