0

(I have already taken a look at this question.)

For at least one application in my system, I am getting an obstinate JAVA_HOME value which I can not seem to change.

Java installed in my system

  • For me:

    $ which java        
    /opt/jdk-10.0.1/bin/java
    
  • For the root user:

    # which java
    /opt/jdk-10.0.1/bin/java
    

Value of JAVA_HOME

  • For me:

    $ printenv JAVA_HOME
    /opt/jdk-10.0.1/
    
  • For the root user:

    # printenv JAVA_HOME
    /opt/jdk-10.0.1
    

Java alternatives

    $ sudo update-alternatives --config java
    update-alternatives: error: no alternatives for java

The places where I have set the value of this environment variable

  • In /etc/environment

    JAVA_HOME=/opt/jdk-10.0.1
    
  • In the .profile file in my home

    export JAVA_HOME="/opt/jdk-10.0.1"
    

The problem

When I execute ~/eclipse/php-oxygen2/eclipse/eclipse for eclipse, it executes successfully. But for the command, ~/eclipse/php-oxygen/eclipse/eclipse, coming from the same package, I get the following error:

enter image description here

I am at a loss to find out how the above value has been set.

Even the following command,

export JAVA_HOME=/opt/jdk-10.0.1/; ~/eclipse/php-oxygen/eclipse/eclipse

produces the same error.

Could somebody please tell me where else can I look to find the source of this spurious value? Eclipse does not have an option in preferences to set JAVA_HOME (internally).

Masroor
  • 3,143
  • Remove the "oracle-java8-set-default" package. – Logix May 18 '18 at 08:48
  • @Logix sudo apt-get purge oracle-java8-set-default, sudo apt-get purge oracle-java8*, sudo apt-get purge java8*. None of these worked. Some thing in the line, Package 'oracle-java8-jdk' is not installed, so not removed Package 'oracle-java8-installer' is not installed, so not removed. – Masroor May 18 '18 at 08:56
  • Just "sudo apt purge oracle-java8-set-default". That's all that should be needed, that's the package that makes Oracle Java 8 default. – Logix May 18 '18 at 08:57
  • @Logix sudo apt purge oracle-java8-set-default Reading package lists... Done Building dependency tree
    Reading state information... Done E: Unable to locate package oracle-java8-set-default
    – Masroor May 18 '18 at 08:58

0 Answers0