Saturday, August 18, 2018

java - cannot set JAVA_HOME

I'm running Linux Mint Quiana. I want to run Android Studio and this requires me Java.

Since i needed NetBeans i decided to install NetBeans with Java 8 bundle from oracle's website. I tried for days to set the JAVA_HOME environment variable but without success. After countless tries and webpages of solutions read. I tried the following:




  1. export JAVA_HOME=/usr/local/jdk1.8.0_20 (The location where JAva seems to be installed)

  2. JAVA_HOME=/usr/local/jdk1.8.0_20 - without the export part and queried echo $JAVA_HOME from another terminal window but it still shows up nothing at all.

  3. I tried to modify /etc/environment and add the above line but without any success. And i also tried to edit /etc/profile but still nothing worked. (by without success i mean that the variable didn't get set)



I really don't know what's up with this thing but it seems very complicated for what it should be a simple command in the shell.




When i type :




  1. update-alternatives --query java I get nothing

  2. java -version I get:



    The program 'java' can be found in the following packages:




    • default-jre


    • gcj-4.8-jre-headless

    • openjdk-7-jre-headless

    • gcj-4.6-jre-headless

    • openjdk-6-jre-headless
      Try: sudo apt-get install
      Which seems stupid to me since i can compile stuff with netbeans and this means that JDK is installed properly somewhere


  3. which java tells me nothing at all




I hope this is enough info to solve my issue.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...