Knowing the full path of the java executable/binary executing thecurrent java program

Discussion in 'Java' started by Kaiser S., Jul 12, 2007.

  1. Kaiser S.

    Kaiser S. Guest

    Hello,

    i need to get the full path of the JRE running my program. I thought i
    could get the java executable path, but how ?

    1/ String.class.getClassLoader() returns null

    ....

    last/ sun specific : the System property "sun.boot.library.path"

    Any better way plz ?
    Kaiser S., Jul 12, 2007
    #1
    1. Advertising

  2. Re: Knowing the full path of the java executable/binary executing the current java program

    Kaiser S. wrote:
    ...
    >i need to get the full path of the JRE running my program.


    Why? What are you trying to achieve?

    >Any better way plz ?


    Spelling words like 'please' fully, is generally considered
    a better way to get people to read and reply to posts,
    around here.

    --
    Andrew Thompson
    http://www.athompson.info/andrew/

    Message posted via http://www.javakb.com
    Andrew Thompson, Jul 12, 2007
    #2
    1. Advertising

  3. Kaiser S.

    Kaiser S. Guest

    Re: Knowing the full path of the java executable/binary executingthe current java program

    Andrew Thompson a écrit :
    > Kaiser S. wrote:
    > ..
    >> i need to get the full path of the JRE running my program.

    >
    > Why? What are you trying to achieve?


    it would be long to explain

    >> Any better way plz ?

    >
    > Spelling words like 'please' fully, is generally considered
    > a better way to get people to read and reply to posts,
    > around here.


    anayway, it's the system property "java.home" :D
    Kaiser S., Jul 12, 2007
    #3
  4. Kaiser S.

    Lew Guest

    Re: Knowing the full path of the java executable/binary executingthe current java program

    Kaiser S. wrote:
    > Andrew Thompson a écrit :
    >> Kaiser S. wrote:
    >> ..
    >>> i need to get the full path of the JRE running my program.

    >>
    >> Why? What are you trying to achieve?

    >
    > it would be long to explain
    >
    >>> Any better way plz ?

    >>
    >> Spelling words like 'please' fully, is generally considered
    >> a better way to get people to read and reply to posts, around here.

    >
    > anayway, it's the system property "java.home" :D


    That's not the path to the executable, but to the Java installation.
    Typically the executable is in the bin/ subdirectory of $JAVA_HOME, and also
    the jre/bin/ subdirectory.

    --
    Lew
    Lew, Jul 12, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Josephine Schafer
    Replies:
    1
    Views:
    3,601
    Philip Morley
    Jul 21, 2003
  2. Replies:
    14
    Views:
    417
    Herbert Rosenau
    May 15, 2006
  3. Shadow123
    Replies:
    0
    Views:
    293
    Shadow123
    Aug 11, 2008
  4. Michael Hoffman

    Finding the full path of an executable

    Michael Hoffman, Jan 16, 2009, in forum: Python
    Replies:
    2
    Views:
    408
    Gabriel Genellina
    Jan 17, 2009
  5. Patrik Kahari
    Replies:
    1
    Views:
    426
    Victor Bazarov
    Oct 21, 2010
Loading...

Share This Page