0

After update of Linux I have an issue with JAVA_HOME directory. echo doesn't find directory for JAVA_HOME.

I have uninstalled java using:

apt-get purge oracle-java8-installer

Then

apt-get update

Then apt-get install oracle-java8-installer

After this I have checked if /etc/environment has correct JAVA_HOME directory and everything is correct but "echo $JAVA_HOME" still returns blank. I couldn't find solutions on google (even on stackoverflow). I am newbie, maybe I am doing something in wrong way.

How I can try to resolve this problem?

On the screen I have attached commands which I used to check correct directory.

https://i.stack.imgur.com/di7FG.png

dzejkob11
  • 11
  • 2
  • 1
    Have you tried it in a new terminal? – ernest_k Jul 29 '18 at 08:12
  • Each shell has it's own environment variables and changing files on the file system won't reload or change them. – Peter Lawrey Jul 29 '18 at 08:13
  • 2
    And why should it not be blank? JAVA_HOME is just an environment variable, that is used by some tools of the Java ecosystem. But it isn't used by Java, and it isn't set when installing Java. So, if you don't create this environment variable, it won't exist. Why do you think you need it in the first place? – JB Nizet Jul 29 '18 at 08:13
  • @ernest_k Yes, with no results. I also did reboot. – dzejkob11 Jul 29 '18 at 08:13

1 Answers1

1

Linux is case sensitive. You are setting JAVA_Home but trying to use JAVA_HOME.

I suggest setting JAVA_HOME only.

Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130