Which versions of Eclipse is compatible with which versions of java? - java

Basically I want to do java programming on my windows system having Windows SP3. Which version of java and Eclipse do I need to download?
Does JDK 1.6 (universal supporter) support all Eclipse and Apache tomcat???

Just go with the latest JDK 1.8 and Eclipse Luna. JDK 1.6 is no longer supported, and 1.7 is pretty much dead as well. Java 8 is far more modern anyway with its new features (lambda expressions, JavaFX 8, new Date framework, etc) and you'll be more competent as a developer knowing those features.
Also, if you are interested in Apache Tomcat you can also check out IntelliJ IDEA instead of Eclipse. I understand it is much easier to do servlet development on.

Related

Java versions confusion

I want to install Java on a few different servers for running a third party service on tomcat.
I am not a Java developer and I got a bit confused when I began searching for the installer.
I checked the different Java versions and their long term support dates.
It seems that Java 11 JDK is - LTS so i decided to use it.
But when I was trying to find a runtime version (JRE?) since this is the version I am supposed to install on the server(?) I only found Java JRE 8.X.X, and this got me confused.
There is no higher major version of the JRE?
How does it work if you use the JDK 11 or even 14-15 as a developer and then use Java 8 JRE on your deployed servers?
Maybe the JDK holds inside of it the Java 8 JRE version?
Or do you actually need to install the JDK version on the servers instead?
The JRE is a subset of JDK. It contains everything needet to run Java applications but no support for development. So, if you need a JRE, a JDK is also good, although it conatins much stuff that you will not need.
Normally, for executing a Java application, you need a JRE with the same version or higher than the JDK used for development. But the developer can advise the compiler to generate code for a lower version. If he does so, he cannot use the features of the higher versions. For example the compiler of JDK 1.8 can produce code for JRE 1.6. You should consult the manual, to see which old versions are supported by the compiler of a specific version.
After some research,
It seems there is no separate JRE section anymore.
Also JDK 11 for production is not free and I guess this is an ongoing trend for the near future.
On a side note there is the open JDK 11 version but it does warn you about outdated security updates.
So basically in my case sticking to updated Java JRE 8 version is good enough for the near future.

Which version of Java is supported by Eclipse Helios?

I'm new to Eclipse and Java. Whenever I run the Java program in Eclipse there is a major.minor 52 exception. I want to know which version of Java is supported by Eclipse Helios. My computer is Windows 7 32-bit OS. So I can't download any other version of Eclipse. Please help me with a favorable answer.
The class file major.minor version 52 error means that Java 8 or newer is required.
Eclipse Helios (3.6) is very old (10 years and 14 releases old). It probably doesn't understand anything above Java 6.
There are 32 bit version of Eclipse newer than this.
Eclipse 4.9 (2018-09) was the last 32 bit Eclipse - that supports Java 8.
OK. Lets start with some history.
Eclipse Helios (3.6) was released in 2010. It supported the latest version of Java that was available at the time; i.e. Java 7.
Eclipse Juna (4.4) was the first release of Eclipse to support Java 8 language features.
Java 7 has been end-of-life for a few years now.
Java 8 (the oldest available version of Java with free support) was released in 2014. This corresponds to the classfile version number (52) of the application that you are trying to run.
Java 8 is also that last version of Java for which you can get a Windows 32 bit version from Oracle.
So what can you do?
If you want to run a pre-built Java application which has classfile version 52, you will have to download and install Java 8.
If you are prepared to rebuild the application, then depending on the application you will probably still need to upgrade to Java 8 to do that. (It depends on whether the application uses Java 8 language constructs or library classes and methods that were introduced in Java 8. It is likely that one or both of those is true.)
If you are going to upgrade to Java 8, it would be advisable to Eclipse to (at least) Luna, but you could go all the way to the 2018-03 release ... which is the last version that supported 32bit Windows.
You could probably also run the application from the command line; i.e. without using any IDE at all. But that would apply to a tool that was designed to run as an Eclipse plugin, etc.
But my strongest advice is to get a machine that can run a 64 bit OS. You can probably get one for USD $300 or less. If your current hardware cannot run a 64bit OS, it must be pretty old, and I am surprised that it still works reliably.
Which version of Java is supported by Eclipse Helios?
Java 7 and earlier versions.
So I can't download any other version of Eclipse.
That is not true. But simply upgrading Eclipse won't solve the problem. You need to upgrade Java as well if you want to run that application.

What JDK should I use for netbeans?

In Netbeans 8.2, it says to use Java JDK 8.1 or higher. When I use the latest version of JDK, Netbeans will load up but I can’t open or make new projects. When I get 8.1 I can’t use certain features of languages, like timers in Java.
What JDK should I use to have both Netbeans functioning and have all features of Java usable?
This document describes how to install NetBeans IDE 8.2 on your system. Please see the NetBeans IDE 8.2 Release Notes for information about supported operating systems and hardware configurations for the IDE. To learn about the new features included in this release of the IDE see the NetBeans IDE 8.2 Release Information page.
And use 8u191 or 8u192 for Netbeans 8.2
Somewhat specific to Ubuntu, or at least Linux: install Java with SDKman which is somewhat like RVM but for Java. Quite simple to install, it will then manage your JDK versions.
Additionally, umake, or ubuntu-make, will install your IDE or other developer tools. This utility is best installed through the snap package manager to get the latest version.
From umake it's a simple command to then install developer tools such as NetBeans. Currently this installs NB 8.2 which will not run on any JDK nine or higher.
Use SDKman to manage your JDK version (and gradle, and kotlin, and ...). Use umake to handle your IDE version.
My two cents
In the next week or so, umake should upgrade to NetBeans o. There was a bit of a mixup when Apache took over but the umake maintainers are on the ball.
Or, just download NB 9 directly. You'll have to use an older JDK, as specified in the first answer by user5377037.
Why are you running NB 8.x?

Eclipse/Java - JDK Compliance

This may seem a daft question so I will be as brief as possible.
Where I work, we deal with lots of Java apps that are compiled on old versions of Java, in fact we recently upgraded one of them to Java 1.6
We've been given new laptops recently with no admin rights and Java 7 installed by default.
I am presently unable to get hold of and install a copy of JDK 1.5 (which I need)
In Eclipse, if I set my JDK Compliance level to 1.5 but the Installed JRE is 1.7
Which of these 2 statements is true... ?
1. I am building my code at Java 1.5 ?
2. I am building my code at Java 7 ?
I've seen and spoken to various people on this subject and I am still non-the-wiser.
It means the byte code that is generated from your source code will be compliant to the 1.5 JRE.
The syntax highlighter will not allow you to do things that were new to 1.6, 1.7 such as switching on strings.
Developing with a JDK higher than the target platform is in principle possible, using the "compliance settings" and/or target version switches with javac.
Its however not practically feasible for doing real development, as nothing will prevent/warn you from using the API's present in your installed JDK but not in the target platform.
If, for example you develop for java 1.4 using an installed 1.5, while the compiler will not let you use autoboxing (which was introduced in 1.5), but it will happily let you use (for example) Integer.valueOf(int). Which is not present in 1.4.

Programming in NetBeans at school and home with different Java JDK versions

So basically, at school our machines have an older version of the Java JDK installed, and I want to work on a netbeans project on home. I have it set up through the github and wanted to know if switching between JDK versions will mess up my project at all, if the older version will allow me to even open the newer version. And, if I can't, was curious on how to open a project in an older version of the JDK.
Thanks!
You just simply need to not use language features introduced after the version your school uses. Netbeans will give you hints if you attempt to use something when the version doesn't support it however (e.g. Diamond operators in 6, or using Lambdas when not using Java 8). So overall I would say you shouldn't be running into any issues, you can even make netbeans recognize the sources as an older version of Java by right clicking your project, and going to:
Properties > Sources > Source/Binary > 1.6 (Or whatever version you need)

Categories