Netbeans and JDK 10 - java

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.

Related

How to Use Java 8 settings to build project in eclipse 4.18(2020-12)

*Due to some project requirements I "have" to use eclipse 4.18 (2020-12) which uses Java 11 by default and is mandatory to start.
But my entire project is/was written in Java 1.7 earlier. Now , in my mac i have both java 1.8 and 11 installed also my eclipse settings are such shown below.
I have made sure removed all java 11 references in my eclipse and made the project and workspace configure to take the 1.8 jdk and run at 1.7 compiler level.*
but when i run ,project -->clean-->build, i run into the JaxB missing in java 11 ( in java 11 JAXB was removed and my project uses jaxB extensively) This is known.
So i am wondering what am i missing that my projects are still building my project with java 11 and not java 1.7 (using jdk 1.8 configured).
Please help.. stuck on this since some days.
machome
Eclipse Compiler setting-1
Eclipse Setting Execution Envs
Eclipse installed JRE's
Eclipse Project specific setting
Java 11 JaxB error
If Eclipse itself is being run with Java 11, and you have a plug-in installed that has not been properly update to work under Java 11, as it appears, you will need an updated version of that plug-in. Update to the latest "oracle design studio", and if you still see this problem, contact Oracle support.
The latest Eclipse may require Java 11 to run, but it's simple to set up Eclipse projects that use older Java versions. Don't mess with the Java version it uses to start up, as long as that is a proper Java 11 version.
As one commenter mentions, you'll have to have a particular Java distribution configured in "Installed JREs->Execution Environments", and then you'll have to have the project configured to use that Java version symbol, like "JavaSE-1.7".

Properly install Java 9 along with Java 8

How do you properly install java 9 along with java 8. I'm currently using Java 8 and Netbeans for a class, but I would like to have the ability to experiment with code using the new JShell. I just don't want to mess up my Netbeans configuration or any other JRE by installing Java 9. How can I do it safely and not disturb Netbeans and my current JRE?
You can give jEnv a try. It's a Java version manager (similar to those available in Ruby, Node etc). It allows you to switch between Java versions (locally, per project, per terminal etc). All the aliases are installed in ~/.jenv directory and will not impact you current working environment.
Once installed you can run Java9 just for current terminal session with jenv shell 9
You should install the latest NetBeans Development IDE, which is downloadable from here:NetBeans Dowload , installing it alongside NetBeans 8.2, for example, is easy as it will autodetect Java JDK 9 (assuming you have installed it) and import your existing settings.
In my case I found that you can't add the Java 9 platform to NetBeans 8.2. You have to install the JDK and then install the NetBeans Development build. Once installed you can use it to create modular projects and use Jshell.

How to change NetBeans Java Project Runtime?

How can I change the Projects Runtime Platform?
(standard NetBeans [8.1] Java Project [Java Application])
Details:
using Ubuntu with NetBeans 8.1
I have installed JDK 1.6, JDK 1.7 + JDK 1.8
My projects platform is Java 6.
My systems default Java is Java 7.
NetBeans-IDE was started with Java 8.
When I run the project via the IDE (Run project), the Project-Platform is used (which is Java 6).
I cannot change the Runtime Platform!
It's always: Project Platform
I tried to Manage Platforms..., but I still can't change the value of the Runtime Platform-ComboBox.
EDIT:
As I wrote in the comments, I don't want to change the Project-Platform.
The project should be compiled with Java 6 but run with Java 8 (when click on Run project).
What I want is:
Project-Platform = Java 6 (used to compile),
Runtime-Platform = Java 8 (used to run).
How can I change the Projects Runtime Platform?
Unfortunately you can't. As you point out, its value can only be Project Platform. Of course that invites the question "What is the point of even having that Runtime Platform field?".
I suspect that it may have been (unwisely) added to the GUI so that at some time in the future it will be possible to actually select a different JDK to run against. There is an open Bug Report for this: Bug 186747 - Can't Build and Run with Different Java Versions.
It's also worth noting that the Help documentation for the Run screen does not mention that Runtime Platform field. My own view is that the field should be removed until it serves a useful purpose.
What I want is: Project-Platform = Java 6 (used to compile),
Runtime-Platform = Java 8 (used to run).
Unfortunately that can't be done, as shown by the open bug. The best you can do right now is:
Create platforms for JDK 6 and JDK 8 in NetBeans.
Set the Java Platform to JDK 1.6 on the Libraries screen, and set the Source/Binary Format to JDK 6 on the Sources screen, then build to verify that no invalid APIs are being used.
Switch the Java Platform to 1.8 on the Libraries screen to run your 1.6 code under 1.8.
I realize that you don't want to do that, but unfortunately there's no silver bullet in the current release of NetBeans (8.2).
An alternative approach would be to build and run using only JDK 8, but include the Animal Sniffer Maven plugin "for checking projects against the signatures of an API", to verify that your 1.6 code was not using illegal APIs. But of course that's only viable for Maven projects.
Please look at Netbeans Project Setup - Setting the Target JDK in a Project
You just have to change the Runtime Platform at the Libraries option, that's all.
Just went through this pain for Apache NetBeans 14. I was trying to set a remote debug for a Raspberry Pi.
It works only if the jdk match on both the local and remote versions. In my case I set them both to 17.
I would have expected that the default jdk on the local machine should have been able to be changed but I fail to determine how.
I am running Ubuntu on the local machine so maybe the platform cannot be changed (don't know). Moving on.
Changed runtime platform

Can't load Java projects in Netbeans 8 after downgrading my mac from Java 8 to Java 7

I had Netbeans working fine with Java 8. Today i removed Java 8 from the system (a Max OS X system) and installed Java 7. Now when netbeans loads it loads without java projects and won't let me create new java projects (i can create HTML projects etc). I looked at the Java Platform settings in Netbeans and it seems to have the correct SDK version (1.7) indicated there. Do you know what might be causing this issue?
I re-installed Netbeans 8 and the problem is resolved.

How to add java 8 to eclipse

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

Categories