How to update java in Ubuntu - java

My Ubuntu 16.04 has the following:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
Can you help me to understand how to update java version for "1.8.0_211" or latest?

That's a very general question. For install see:
http://tipsonubuntu.com/2016/07/31/install-oracle-java-8-9-ubuntu-16-04-linux-mint-18/
if it's already installed then
sudo apt update
sudo apt upgrade

Related

IntelliJ won't recognize JDK on Ubuntu

I installed openjdk using the command:
sudo apt install openjdk-11-jre-headless
java -version command correctly displays the installed package
openjdk 11.0.15 2022-04-19
OpenJDK Runtime Environment (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1)
OpenJDK 64-Bit Server VM (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1, mixed mode, sharing)
However, when I open the IntelliJ IDEA environment, and want to run the first project, the environment does not detect the sdk
Should I configure something else beforehand, I haven't had much experience with Ubuntu before, for comparison in windows using the command -java version I get this message: completely different from what I get on ubuntu and everything works fine
java version "17" 2021-09-14 LTS
Java(TM) SE Runtime Environment (build 17+35-LTS-2724)
Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
That's because you've installed JRE instead of JDK.
see: What is the difference between JDK and JRE?
Just try sudo apt install openjdk-17-jdk

Get older mac java version 1.8.0_161

I need to get this exact version of java on my new mac os. I cannot find it at:
https://www.oracle.com/java/technologies/oracle-java-archive-downloads.html
Old machine:
cmuench:~$ 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)

how to change the java path that is being referenced

I had had previously installed java on my mac. I just downloaded a new version of java from their website. when i run java -version in my terminal I get this
omars-mbp:local omarjandali$ java -version
java version "12.0.1" 2019-04-16
Java(TM) SE Runtime Environment (build 12.0.1+12)
Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)
omars-mbp:local omarjandali$
I want delete the version above and have to point it to the new java version that I just downloaded which is
version 8: (build 1.8.0_211-b12)
how can i redirect it accordingly

elasticsearch won't start because it can't find java 8

I'm trying to run an instance of elasticsearch version 1.8 on an ubuntu machine.
When i elasticsearch I get:
es#ubuntu-mwa-flask:/root/elasticsearch-5.4.0$ ./bin/elasticsearch
Error: Could not find or load main class org.elasticsearch.tools.JavaVersionChecker
Elasticsearch requires at least Java 8 but your Java version from /usr/bin/java does not meet this requirement
I've checked which java version I have:
es#ubuntu-mwa-flask:/root/elasticsearch-5.4.0$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
What am I doing wrong? I've installed elasticsearch on afew machines before, why doesn't this one work?
edit1: since someone asked:
es#ubuntu-mwa-flask:/root/elasticsearch-5.4.0$ /usr/bin/java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
mixed mode)
edit2:
es#ubuntu-mwa-flask:/root/elasticsearch-5.4.0$ javac -version
javac 1.8.0_131
Probably you don't have right permissions. Try to set them to 774 and check again:
sudo chmod 774 -R elasticsearch-6.3.2/

Suitable Eclipse Release?

I'm new in java and want to install Eclipse. What's appropriate version should i install as
java version "1.6.0_38"
Java(TM) SE Runtime Environment
(build 1.6.0_38-b05) Java HotSpot(TM)
Client VM (build 20.13-b02, mixed mode, sharing)
jdk1.6.0_38
jre1.6.0_38
You can install any eclipse version.There is not jdk version required for installing eclipse

Categories