What is JDK minimal version is required for compiling GWT client code (I think JDK 1.7 for GWT 2.7) ?
What is JRE minimal version is required for running GWT RPC on servlet container (I think JRE 1.5 for GWT 2.7) ?
The only answer I found is GWT FAQ is JRE 1.5 but for compiling or running ? It is not clear for me.
In fact, I want to know what the JDK required for a developer computer and what the JRE required for a production server.
According to the build files, GWT 2.7 (and actually since 2.5.0) required Java 6: GWT is compiled with Java 6, producing Java 6-compatible classes, and runs its own tests with Java 6.
Note that GWT 2.8.0, to be released later this spring, will require Java 7.
Related
I regularly use MALLET for topic modeling in the classes that I teach. Running MALLET requires users to have the Java Development Kit installed. I currently have JDK 8 update 241 installed on my main computer, and I know that MALLET works properly in this environment. That said, JDK is now up to v14.
Which version(s) of JDK does MALLET support?
I'm not altogether sure that you do need the JDK. They never say that on the website. The tarfile that I downloaded already includes compiled classes - you aren't expected to build it from source - so the JRE should be enough.
Strangely enough, the compiled classes in the class directory are targeted at 1.7 (bytecode version 51) whereas the pom indicates that it's supposed to target Java 1.6. So it's quite probable that by rebuilding it you could support an older version of Java.
In any case, the JDK is backwards compatible by design. Any version from 7 onwards will be able to run it (6+ if you were to rebuild it).
Running it on a newer version will benefit from the new features of the JDK, such as improvements to the garbage collector, so you may see some performance improvement there. If you are not concerned about that then it doesn't matter.
We are planning to upgrade our J2EE application, I worked with a lot of jars before and I know that the version mismatch can be a hard problem to debug. We have all the jars(internal to company and built by some other team so cannot recompile with latest version ) compiled using 1.6 jdk and we are bumping up our application version to 1.7, but we are planning to use 1.6 version jars in our app. Does this work well? If not what should I do to make it compatible?
I'm sure that it will work well but, need some expert opinion on this.
Thank yo
As you can see on Oracle's homepage regarding compatibility of Java 1.7 it should be compatibale except for the following things
Binary Compatibility
Java SE 7 is binary-compatible with Java SE 6 except for the
incompatibilities listed below. Except for the noted incompatibilities,
class files built with the Java SE 6 compiler will run correctly in Java SE 7.
Quote from oracle
My question is if Java JDK and JREs have to be compatible to run?
I mean: will Java applications written using JDK version 8 in future work with current JRE's?
It is possible to use cross-compilation options when compiling. Do that and it will be possible to compile code with SDK 8 that is compatible with Java 1.1. It won't be very advanced code for 1.1, but it will run.
The short answer is No.
If you develop your application in JDK 8 and run it with JRE 7, you would get an UnsupportedClassVersionError.
This question is two part:
JDK vs JRE
forward / backward compatibility.
JRE is the acronym for Java Runtime Environment. JDK is the acronym for Java Development Kit: a set of tools which you use to develop Java programs. The JDK also contains a full JRE. In general there is no compatibility issue between the two. But you might want to take care not to use libraries which are only available in the JDK (for example code generation or the tools.jar)
Java itself is compiling to bytecode, which is forward compatible. That means you can use bytecode of any Java version and run it with any newer version. The other way around generally doesn't work and is checked by using the class file version ("java.lang.UnsupportedClassVersionError: Test : Unsupported major.minor version 51.0").
Then there are Java libraries, including the core libraries. So far there was never anything removed from them, so they are forward compatible. This is probably going to change with Java 9 where a very small usually unused library functions are removed.
Regarding to backwards compatibility, this is possible by setting the Java compiler to produce Bytecode of an older version. Up until Java 8, the compiler was always able to produce bytecode of the last two major versions as well. However, you might successfully compile a Java 8 source to Java 6, but not be able to run it. That is the case when you use libraries that are only available on a never Java. For such cases there is for example the maven animalsniffer plugin which will verify that when you compile against an older version, you actually only use libraries existing in said version.
I am new to java so I dont know if my question makes sense. I have a jar which I got from another developer and this jar is compiled in java 1.7 and I am using 1.6. So when I run this application, it gives me a Unsupported major.minor version error. So,I would like to know is there a way that I can recompile the jar in 1.6 somehow? I cannot update my java version to 1.7 because, the development system cannot be connected to internet.
Thanks
There are some approaches like Retrotranslater, but it seems that it has not been updated for 1.7 => 1.6 (we used this some years ago for 1.5 => 1.4 or similar).
The general advice is to compile the source code with 1.6 (which should be easy if no 1.7 specific features are used).
Otherwise, you should really consider updating your java version to 1.7 somehow, since 1.6 is at its end of life already. Even if your development system is isolated, there must be some connectivity since somehow you also transferred the jar file from the other developer. With the same approach, you should be able to transfer the JDK installation package.
See also this question for more background information: Compiling Java 7 to Java 6
I'm trying to run webservice client on JDK 1.5 and it gives me many errors such as classnotfound exception, nosuchmethod... Is it possible to add some libs such as jax-ws, axis... and run it under JDK 1.5?
What's the best approach? I have NetBeans 6.9.1 on JDK 1.6, created project compatible for JDK 1.5. It works on my machine but on other with only 1.5 doesn't.
If you want to develop for JDK1.5, then download JDK1.5, and use it to develop your application. NetBeans allows using another JDK than the one it comes with.
You're shooting yourself in the foot by targetting JDK1.5 and developing on JDK1.6.