find java home in linux

This post is only for my use. I have copied this content from stackoverflow

Any of the below command will give the java home in Linux

 java -XshowSettings:properties -version 2>&1 > /dev/null | grep ‘java.home’
 jrunscript -e ‘java.lang.System.out.println(java.lang.System.getProperty(“java.home”))’;
 echo $(readlink -f /usr/bin/java | sed “s:bin/java::”)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s