I have been developing my application in the Oracle JDK 1.6 development environment. When I move it to a different environment the code started getting broken, until I figured out the culprit was the environment was configured to OpenJDK 1.6.
After I installed Oracle JDK 1.6 in the second environment everything looks alright. Out of curiosity, how does the same Java version implementation have this effect? Aren't these implementations for the same specification?
Related
I downloaded Eclipse C/C++ for Linux Mint and it is giving me the above error when I try to open it. Does this mean that Eclipse cannot be used in Linux with its current version of OpenJDK? How can I correct this?
This warning is not critical however it indicates that you are using an old Eclipse version, most likely from before Java 8. You shouldn't expect that an old version of Eclipse will work with current version of OpenJDK.
At the moment we have OpenJDK 11 (potentially 12). Update your Eclipse to current version that supports OpenJDK 11 e.g. Eclipse 4.10 or 4.11.
I just installed jre-8u72-macosx-x64.dmg from this page, the installation worked well.
However, when I type /usr/libexec/java_home -v 1.8 it returns:
Unable to find any JVMs matching version "1.8".
/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home
Does anyone know where is Java 1.8 installed?
PS: I need this to install Eclipse IDE for Java Developers, which requires Java 1.8+ VM.
You should install JDK 1.8, currently you are using a JRE. On OS X, installing just the JRE doesn't make it available as the system default available to applications.
As of January 2016, you can download JDK 1.8 for mac from
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Because Oracle tends to change their URLs, that link might go dead. Best to do a web search for "JDK mac" or something similar to find the latest version.
I have a question regarding the compatibility between different java versions.
On my computer, I have java version "1.7.0_02".
But when I uploaded the .class and embedded it in a webpage it does not work
I get the error:
"Unsupported major.minor version 51.0"
the heading at the top of the console says:
"Java Plug-in 1.6.0_31
Using JRE version 1.6.0_31-b05 Java HotSpot(TM) Client VM"
I would like to ask what is causing the problem. Is it really my java version?
I mean, I visited the site with the computer I compiled the applet in.
You can't use classes compiled to Java 1.7-compatibility class files with an earlier virtual machine, and that "Java Plug-in" error you're seeing says that's exactly what happen.
Two options:
if you're not using Java 1.7 only features, you can compile your code to be compatible with 1.6 JVM's using the option -target 1.6 (see docs here)
Upgrade the Java plug-in your browser is using to 1.7, if possible (I don't think you can do this on OS X, for example). You didn't note what OS and browser you're using so I'm not sure what the upgrade path would be, if any.
Thanks for the answers, I figured out what was wrong.
I started off with both 1.7 and 1.6 on my machine, and it was really confusing me.
The problem was, 1.7 was 64 bit, and 1.6 was 32 bit.
My browser was chrome 32 bit.
I just installed 1.7 32 bit and it was fine
I have both JRE 1.6 and JRE/JDK 1.7 installed on my PC. Do I need both JREs, or can I just keep JRE 1.7 and uninstall JRE 1.6?
I only occasionally have anything to do with the JDK so I'm largely unfamiliar with the Java world. Mostly I just need the JRE for the misc application that needs it.
I do know from PHP web development experience that I need both PHP 5.1 and 5.3 due to deprecation versus enhancement issues, so I was not sure if JRE 1.6 and 1.7 were similar.
Please advise.
Unless you have something that specifically depends on JRE 1.6, you can just keep 1.7.
In general, the Java language is very backwards compatible, so such dependencies on older versions are rare.
There is one special concern with the 6-to-7 leap, though: Oracle changed the licensing model for Java distribution, so you must be aware that OpenJDK 1.7 and Oracle Java 1.7 are not quite the same. So if you have Oracle JDK 1.6, you can't necessarily replace it with OpenJDK 1.7 -- you might have software that depends on the proprietary Oracle-only packages.
JRE 7 should be backward compatible with 6. Since you said JRE, and not JDK, I'd say you're safe to remove JRE 6.
if you have JRE 1.7 then I think you don't need the JRE 1.6. you will get all the features of JRE 1.6 in JRE 1.7
If you have JRE 7u45, you may have issue while reading system properties from JNLP files, in this case better to use java 6
Are Open JDK and JDK7 the same thing?
Open JDK is a free (but not certified) implementation of the JLS (java language specification) where JDK7 is the next version of Sun's JDK which is currently 1.6 (or just Java 6 as the marketing devision of Sun called it).
OpenJDK was initially based only on the JDK 7.0 version of the Java platform.
Since February 15, 2008, there are two separate OpenJDK projects:
The main OpenJDK project, which is based on the JDK 7.0 version of the Java platform
The JDK 6 project, which provides an Open-source version of Java 6.0.
I hope this clears the confusion a bit.
It appears to be a Solaris<-->OpenSolaris situation, viz. there's an open-source project with as much code as possible; the fixes get transferred back to the main software, which the vendor supports and sells. OpenJDK is a project. OpenJDK version 7 and JDK7 appear to be largely but not exactly the same (per here).