IntelliJ won't recognize JDK on Ubuntu - java

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

Related

JDK8 for NetBeans 12.2?

I'm trying to install JDK8 as a platform on NetBeans 12.2, but I keep getting this error message:
"Cannot detect and install the selected platform. The java or javac may not be executable."
Is there a way around this? Or is there a version of JDK8 that won't yield this error message?
Further: I should have mentioned that I'm on MACOS Big Sur.
Here's what I get with java -version in Terminal:
java version "15.0.2" 2021-01-19 Java(TM) SE Runtime Environment (build 15.0.2+7-27) Java HotSpot(TM) 64-Bit Server VM (build 15.0.2+7-27, mixed mode, sharing)
And here's what I get with javac -version:
javac 15.0.2
You are probably getting this message because the JDK executables haven't been added to your path as environment variables. Directly from the official java website, here's a guide on how to fix this problem.

Java throws "Repository Does Not Have Release File" when running apt-get update on Ubuntu 19.10

Whenever I try to run apt-get update in my Ubuntu 19.10 machine, I get the error E: The repository 'http://ppa.launchpad.net/webupd8team/java/ubuntu eoan Release' does not have a Release file.
I have installed OpenJDK v 13 on this machine and can use Java commands with no issue, including my IDE's.
Java version as shown by java --version shows me this:
openjdk 13 2019-09-17
OpenJDK Runtime Environment (build 13+33-Ubuntu-1)
OpenJDK 64-Bit Server VM (build 13+33-Ubuntu-1, mixed mode)
Any ideas?

How to update java in Ubuntu

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

Check the if version of JDK installed on macOS is the correct one

I have a macbook with latest HighSierra installed and from System Preferences / Java Panel. It says that i have got latest Java version installed: java 8 update 181.
From the "Java" tab of the aforementioned "Java settings" dialog i can see that the version 181 it is referring to is installed in /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java
If i try to execute that binary (i.e. java -version) i actually get:
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build
1.8.0_181-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
however when i try to launch "java" from a generic prompt or if i try to execute javac i get a different result:
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
this latter java is installed in /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/
So it seems to me that i have got a jre (181) and a jdk (40) is this correct?
if so, is this the correct setup on mac? i started to wonder when forticlient analyzer showed up a bunch of CVE security issues related to JDK that are fixed in update 181.

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