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.
Related
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)
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.
Migrate from Oracle JDK to OpenJDK.
My services installed OracleJDK package version:
1.
java version "1.6.0_45" Java(TM) SE Runtime Environment (build
1.6.0_45-b06) Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
2.
java version "1.8.0_151" Java(TM) SE Runtime Environment (build
1.8.0_151-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
3.
java version "1.7.0_67" Java(TM) SE Runtime Environment (build
1.7.0_67-b01) Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04, mixed mode)
What are OpenJDK versions same with each my OracleJDK version?
Please help me
I'm not sure that this is going to help, but the OpenJDK version numbers match the Oracle JDK version numbers.
The problems are:
Where do you find a downloadable build of OpenJDK for a particular version and hardware platform.
(For Linux and similar) how do you map the OpenJDK version to a package or set of packages for your preferred distro.
Certainly, you are unlikely to find Java 6 or Java 7 packages for recent releases of Linux in the standard package repo's. (Recent versions of Fedora, for example, only have Java 8 and later.) When Oracle stopped public support for Java 6 and Java 7, the OpenJDK-based packages were deprecated.
However, if the builds exist you should be able to find them based on the information in the following OpenJDK page:
How to download and install prebuilt OpenJDK packages
If you cannot find packages, and if you are willing to put in the necessary effort, it should be possible to download the relevant OpenJDK sources and create your own builds.
But my advice would be to upgrade your Java platform to Java 8, with a view to upgrading to Java 11 soon. If you can't afford the effort and (potential) risk of upgrading, then you would be advised to pay for a Java support contract.
I'm trying to install Netbeans 8 but the installer is not finding JDK.
But, I can't update my Java, I installed the update 51 of java 7 but when I go in terminal I get it:
Alessandros-MacBook:~ alessandrogarcez$ java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
In "System preferences", I have version 7 installed.
It seems to have both version of java installed in my mac.
Someone can help me to solve it?
Thanks
I was trying to install jre-7u45-macosx-x64.dmg and I don't know why it doesn't overwrite java 6.
I've read a lot of topics, tried all of them.
http://support.apple.com/kb/DL1572?viewlocale=en_US
http://www.cc.gatech.edu/~simpkins/teaching/gatech/cs2340/guides/java7-macosx.html
After all of it, I just downloaded jdk-7u51-macosx-x64.dmg and it worked. The version 7 overwrited the 6.
Alessandros-MacBook:~ alessandrogarcez$ java -version
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)
Eclipse complains: JRE version is 1.6.0; version 1.7.0 or later is needed to run Google Plugin for Eclipse.
In the Terminal, java concurs:
> java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
But in System Preferences \ Java \ the Java Control Panel says Your system has the recommended version of Java: Java 7 Update 51
and points to /Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java.
Eclipse preferences show that the installed JRE is at:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
To point Eclipse to Java 7 (1.7.0), it's enough to change the preference:
What is the source of the discrepancy in Java versions? Is this an instance of having different PATHs between the command-line Mac and the windowed-Mac?
Edit
If I edit /usr/local/adt-bundle-mac-x86_64/eclipse/Eclipse.app/Contents/MacOS/eclipse.ini by adding
-vm
"/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java"
Eclipse refuses to start.
And yet this is indeed 1.7:
> "/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java" -version
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)
If you want to be certain of the JVM that is used to run Eclipse, you need to specify it in your eclipse.ini file, according to these instructions.
Installing this update might fix your problem:
http://support.apple.com/kb/dl1572