I am trying to setup netbeans 15 for Java development but the glassfish installed could not be added. The wizard asked me to create domain manually on command prompt but while trying to do that I got the error message:
glassfish requires version 6 but your jdk version is 0.
I have ensured my environment variables are well set
It is tricky to ensure that you are using an appropriate version combination of NetBeans, Java and GlassFish. I don't know of any single piece of documentation that helps, but this is what you can do:
Refer to the Release Notes for your NetBeans installation (e.g. Downloading Apache NetBeans 15) to determine which Java versions it supports.
Refer to the Eclipse GlassFish documentation to determine which Java versions GlassFish 6.x supports.
In your case, although you don't mention you GlassFish version, since you are using NetBeans 15 you must use a JDK >= 11. From the Release Notes for NetBeans 15:
The Apache NetBeans 15 binary releases require JDK 11+, and officially
support running on JDK 11 and JDK 17.
So your current NetBeans environment which uses JDK 10 is invalid. GlassFish is not your biggest concern; you need to update NetBeans to use a valid JDK first.
This answer summarizes GlassFish 6.x <=> JDK compatibility. If you are using a GlassFish release < 6 then you must use JDK 8 which is not supported by any recent release of NetBeans.
And regardless of all that, unless you have a compelling reason for doing so, you should stop using JDK 10. It is unsupported, may present security risks, and is definitely problematic for a working NetBeans/Java/GlassFish environment. Once you have installed a valid JDK, also ensure that you remove all traces of JDK 10 from your environment.
One stable combination you might consider is NetBeans 15 + JDK 11 + GlassFish 6.1, but there are plenty of other possibilities.
Update your question if you still have problems after upgrading your JDK.
Related
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.
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.
Our company is planning to move towards AdoptOpenJdk 11 from Oracle JDK8 with Wildfly 10 running on it. All the code and wildfly server will be same(written and supported by JDK8) and since java is backward compatible, I think that it should work theoretically, but are there any issues that we have to be aware of?
There are a lot of updates from JDK 8 to JDK 11. I would recommend just moving to AdoptOpenJdk 8 in the short term. Your specific code may be ok, but you also have a huge set of dependencies that may be using something that needs updated. For example, what is your build tool? Gradle needed to be updated because it needed a newer version of ASM. Are you using JAX-RS? Jersey 2.27 doesn't work on Java 11.
JavaEE is in a weird place right now because Oracle basically dumped it on the Eclipse foundation (now called JakartaEE). It will take a little while for it to be sorted out.
I have migrated from openjdk-8 to openjdk-11.
Steps I follow:
1. Add missing Java dependencies in jdk11
2. Upgrade/remove supported plugins (Need to upgrade ASM to 7.1, cglib or other byte manipulation libs)
3. Change JAVA_OPTIONS related to GC.
4. Wildfly support for java11
More details on libs versions check the link
I have been using Netbeans upto 8.2 for several years. But now I have installed JDK 10 and was forced to migrate to Eclipse. But I do not feel very comfortable. I would like to go back to Netbeans.
Does Netbeans support JDK version 10 now? I mean July, 2018.
Yes, NetBeans supports Java 10, but there are several important caveats to be aware of:
NetBeans 8.2 does not support Java 10. It just won't work.
NetBeans 9 supports Java 10. It was released yesterday (July 29, 2018).
NetBeans 9 only officially supports Java SE. Some options (plugins) available on NetBeans 8.2 are not provided on NetBeans 9 by default, such as Java EE and C/C++. However, there is a way to add those options (at your own risk). See this answer to How to get Netbeans 9 to deploy a valid webapp on Tomcat for details. Also see What's Happened to My Favorite NetBeans Plugins?
Notes:
NetBeans 8.2 is an Oracle product, but they are in the process of handing the NetBeans components over to Apache, and NetBeans 9 comes from Apache. The transition explains why many plugins are not available in the initial release of NetBeans 9, but they will become available in coming releases.
The NetBeans 9 download is in the form of a single zip file for all operating systems. Just unzip to a folder, then locate and run netbeans64.exe (or netbeans.exe for 32-bit).
Updated to add further notes:
You can safely install and run NetBeans 8.2 and NetBeans 9 concurrently.
The default platform for NetBeans 9 is still Java 8. You must explicitly add JDK 10 as a platform: Tools > Java Platforms > Add Platform...
To create a Java 10 project, open the project's properties and ensure that the following are set:
Properties > Libraries > Java Platform: JDK 10
Properties > Sources > Source/Binary Format: JDK 10
An easy way to verify that JDK 10 is set up correctly is to create a trivial Java application and put this code in the main() method: var v = 123; System.out.println("v=" + v); If that compiles and runs you are fine (and vice versa).
Netbeans 9 started working for me after I moved to JDK 10.0.2 instead of 10.0.1 ..... may be it will help guys who are struggling like me.
Enjoy.
I've an old machine running Windows XP 32.
Because Oracle dropped support for WXP 32 bits, I've manually installed the jdk following
the awesome answer here:
installing JDK8 on Windows XP - advapi32.dll error
I've however not added it yet to the JAVA_PATH, which is set to jdk 6. I don't know if it would harm or not to add it as well, but I want to be conservative here because a lot of programs in this machine need jdk 6. I don't want to break anything working now.
I'd like to toy around in eclipse to test the new Java 8 features. I've manually added the new jre 8 in the "Installed JREs" section under window -> preferences. In the compiler combo, the highest level available is 1.7 (installed jdk7 some time ago, this time using the official installer, but I still keep java 6 as the default in the system). I don't see any option to add the new level.
Consequently, when creating a new project using the new JRE, a warning is shown saying:
The current workspace uses a 1.4 JRE with compiler compliance level
1.6. This is not recommended and either the JRE or the compiler compliance level should be changed.
Seems a problem derived from the manual installation of the JDK.
I'm using Eclipse Kepler v4.3.1, but I have also tested this in older 3.x install with identical results.
Any help will be appreciated.
Support for Java 8 in Eclipse Kepler 4.3.2 is described here. This basically says specify
http://download.eclipse.org/eclipse/updates/4.3-P-builds/
as the 'Work with' site on Install New Software and select 'Eclipse Java 8 Support'.
Recent builds of Eclipse 4.4 Luna (since 18 March 2014) have Java 8 support included (but Luna is still under development).
Update:
Eclipse Luna (4.4) was released on 25 June 2014