Safari
Safari

Reputation: 11935

How to know JAVA_HOME value?

How can I know the value of JAVA_HOME variable on Ubuntu Server?

I tried with echo $JAVA_HOME but I read a white line.

Upvotes: 0

Views: 5729

Answers (3)

Dheemanth Bhat
Dheemanth Bhat

Reputation: 4452

You might have checked the value immediately after setting it in /etc/environment file.

Solution: Try manually refreshing the file by typing below in the command prompt.

Note: observe the "." before the path "/etc/environment".

. /etc/environment

Alternate solution is try STEP 8 shown here.

Upvotes: 0

You can just type:

$JAVA_HOME

If that doesn't give you anything maybe the variable isn't set up yet, you can try typing:

JAVA_HOME=/your_java_home

and then typing

$JAVA_HOME 'or' echo $JAVA_HOME

to see if it works.

Upvotes: 0

marekful
marekful

Reputation: 15351

It's echo $JAVA_HOME on a Linux command line.

Upvotes: 1

Related Questions