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

K

Kaiser S.

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 ?
 
A

Andrew Thompson

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.
 
K

Kaiser S.

Andrew Thompson a écrit :
Kaiser S. wrote:
..

Why? What are you trying to achieve?

it would be long to explain
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
 
L

Lew

Kaiser said:
Andrew Thompson a écrit :

it would be long to explain


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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top