Change java version from 1.8.0_161 to 1.8.0_151 Ubuntu 16.04
By Emma Martinez •
I am using ubuntu 16.04 LTS.
...$ java -version
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
...$ echo $JAVA_HOME
/usr/lib/jvm/java-8-oracleI have tried to use multiple versions of java using the answer mentioned is this post.
...$ which java
/usr/bin/javaDownloaded jdk 1.8.0_151 from this link:
Extracted it in home/b/ then tried the following command as mentioned in the post.
...$ export PATH=/home/b/jdk1.8.0_151/bin:$PATH
... $ which java
/usr/bin/javaI am still getting the same java.
I have also tried:
...$ sudo update-alternatives --config java
here is 1 choice for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------ 0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 auto mode
* 1 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual modeThis is my $PATH:
...$ echo $PATH
/home/b/jdk1.8.0_151/bin:/home/junaid/anaconda2/bin:/usr/local/sbin:/usr/local/bin:
/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:
/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/binShould I remove Java and download again? If yes, then how?
1 Answer
I had an issue as follows:
>Checking build tools versions...
>************************************************************
>You asked for an OpenJDK based build but your version is
>java version "1.8.0_161" Java(TM) SE Runtime Environment (build 1.8.0_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode).
>************************************************************
>build/core/main.mk:175: error: stop.
>09:36:38 ckati failed with: exit status 1
>build/core/main.mk:21: recipe for target 'run_soong_ui' failed
>make: *** [run_soong_ui] Error 1
>#### make failed to build some targets (01:40 (mm:ss)) ####The issue is solved for me by removing Oracle path from $EXPORT.
More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"