Ubuntu 18 downgrade openjdk 8 version - java

Hello I'm using Ubuntu LTS 18.04 and my java version is
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~20.04-b01)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)
I want to downgrade 1.8.0_275 to 1.8.0_265 how can ı do this ?

You need to download a zip with the version you are looking,unzip the content and add the path to the bin folder in your PATH environment, here is a repo with the oldest you mention:
https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/tag/jdk8u265-b01
Also I'll recomend you to use https://sdkman.io/
And if you download a version that loses support is still listed in your machine and you can change your version easily.

Related

The package is accessible from more than one module problem under VSCode only

I have a project which builds fine under gradle as well as in the IntelliJ IDE run configuration.
But it gives a problem in the VSCode IDE:
The package javax.crypto is accessible from more than one module
The are no module-info.java file in the entire project.
The modules listed are:
~/Desktop/dev/projects/pid2 % java --list-modules
java.*
jdk.*
The VSCode home setting for the JDK is:
"java.home": "/Users/stephane.eybert/.sdkman/candidates/java/current",
and it is the version:
~/Desktop/dev/projects/pid2 % /Users/stephane.eybert/.sdkman/candidates/java/current/bin/java -version (master)pid2
openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)
I tried with changing the JDK so as to use the same one as IntelliJ is using, but the problem remained the same.
The IntelliJ JDK version is:
~/Desktop % /Applications/IntelliJ\ IDEA.app/Contents/jbr/Contents/Home/bin/java -version
openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+10-b304.77)
OpenJDK 64-Bit Server VM (build 11.0.4+10-b304.77, mixed mode)
The VSCode version is:
Version: 1.40.0
Commit: 86405ea23e3937316009fc27c9361deee66ffbf5
Date: 2019-11-06T17:09:34.601Z
Electron: 6.1.2
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Darwin x64 19.0.0
For me the issue is on java.util package.
In each java project there will be .settings folder created by vscode, in that folder open org.eclipse.jdt.core.prefs file, change the org.eclipse.jdt.core.compiler.compliance option from 11 to 1.8 and clean workspace
or
Changing the maven-compiler-plugin source and target to 1.8 worked for me.
Both the ways worked for me.

How to Verify which openjdk distribution vendor on RHEL RedHatLinux machine?

On checking with java -version get the output as
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
Wants to ensure this openjdk binary is from oracle or redhat.
While checking on JMX VM Summary page it shows the Vendor name as "Oracle Corporation". Does this mean its oracle provided openjdk distribution ?
What should be the vendor name for RedHat OpenJDK distribution ?
In general, java -version from Oracle's builds say
java version ...
Instead of
openjdk version ....
The java.vendor system property, unfortunately, has compatibility issues. It can't be changed without (potentially) breaking users.
For example, changing that property from Sun to Oracle once broke eclipse: https://it.slashdot.org/story/10/07/28/2121259/oracles-java-company-change-breaks-eclipse
So OpenJDK distributors are very very cautious about changing these vendor properties. Pretty much everyone will stick to the default values for pretty much all the system properties.
If you have installed OpenJDK on RHEL and you are using the java-*-openjdk packages, those have been built and are being maintained by Red Hat. You can find out what package that is by using rpm:
rpm -qf $(readlink -f $(which java))
If you see java-1.8.0-openjdk-headless, that's the package maintained by Red Hat.
openjdk is from oracle. i think the redhat just put binaries of openjdk in their repository. so the vendorname is oracle.
Oracle jdk is named as Hotspot
$ java -version
java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)
Non-oracle jdk
$ java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

UnsupportedClassVersionError... but with same JAVA version

I am trying to migrate a tomcat server.
Both are using tomcat7 version and all is supossed to be ready to take my java/jsp files from one server to another.
I did and I got UnsupportedClassVersionError error.
It was normal as in the old one I had JRE 1.8 version and in the new installation I had JRE 1.7 version (both from Oracle).
I proceeded to upgrade the second to 1.8. And everything was fine as in the new the output for java -version is:
java version "1.8.0_191" Java(TM) SE Runtime Environment (build
1.8.0_191-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.191-b12, mixed mode)
While in the old one:
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)
In both echo $JAVA_HOME outputs:
/usr/lib/jvm/java-8-oracle
I restarted tomcat and server itself... but the UnsupportedClassVersionError persists.
I don't know if:
Somewhere I still point to the JRE 1.7 installation
Or 1.8.0_191 is considered another version than 1.8.0_131
Note: the compiler is the same as they have not been recompiled. Just take the compiled ones from old server (where there is no problem version) to the new one.
Has anyone a hint for me?
Thank you very much
As pointed in comments, sometimes JAVA_HOME is not checked and the decision on what jvm should be used is taken with another criteria (can't say which ones). So removing the old version of java forced the process to choose the desired one as it was unique.

NetBeans Not Working, New Projects On Linux

I installed Netbeans today, and downloaded java JDK yesterday.
When i try to create a new project it douse nothing. I checked if i have java JDK in the terminal by typing
#Terminal
java -version.
#Output
openjdk version "10.0.2" 2018-02-17
openJDK Runtime Environment (build 10.0.2+13-Debian-1)
openJDK 64-bit Server VM (build 10.0.2+13-Debian-1, mixed mode)
I have:
#NetBans File
netbeans-8.2-linux.sh
#Java JDK
jdk-11.0.1_linux-x64_bin.tar.gz
Netbeans 8.2 isn't compatible with Java 10. Download the latest version. The support to Java 9 and 10 was added in Netbeans 9. You can see more here:
http://netbeans.apache.org/download/nb90/

How to find the java update version?

I have a jre installed installed in my windows.
When I use the command
java -version
I get the output -
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode)
I can see only the major version 1.7.
How to know which version of JRE update it is ?
Calling java -version will give you the installed version, including the update number (here: 51):
java version "1.7.0_51"
Java(TM) SE Runtime Environment (build 1.7.0_51-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)
It seems like you have the base version installed, so there is no update number:
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode)
I guess the build gives you the update you have.
You can try this as well-
java -fullversion
Version number translation: 1.6.0_34 is, in English, Java 6 Update 34
Looking at this page from the release note: http://www.oracle.com/technetwork/java/javase/jdk7-naming-418744.html
It seems you have the 1st java 7 version.
Oracle periodically makes updates available and, when an update occurs, the version string will also include the update version number. So, JDK 7 update 4, or JDK 7u4, will have the version string "1.7.0_4".
Normally the jre folder is named something like 1.VersionNumber.0_UpdateNumber
For 64 bit you can find this folder under C:\Program Files (x86)\Java
If your version Number just look like this: 1.VersionNumber.0, this means that you have the first release of given Java Version.

Categories

Resources