No classes when adding JDK9 Platform to Netbeans - java

I am having problems adding the new JDK 9 Platform to Netbeans. Here are the steps I followed:
I downloaded Java 9 from here: http://jdk.java.net/9/ and ran the installations.
In Netbeans I went to Tools, then Java Platforms
Clicked on Add Platform
Selected Java Standard Edition
When asked to choose the platform folder selected "C:\Program Files\Java\jdk-9"
As Platform Source I selected "C:\Program Files\Java\jdk-9\lib\src.zip"
And for Platform Javadoc I filled in "http://download.java.net/java/jdk9/docs.api"
Now I see that if I click on the new JDK 9 platform Sources and Javadoc seem correct, but classes are empty. When I set a project to use the new JDK9 platform I get a lot of exceptions along the lines of "Cannot find package java.lang".
Who can help?
Thank you

Issue has been solved. The solution was to install Netbeans Daily Development Build instead of the Netbeans 8.2 that I use.

Related

NetBeans: "Failed to automatically set-up JavaFX Platform"

I have been troubleshooting this error for the past few days - and have hit a brick wall. I am running NetBeans v11.3, and Ubuntu Bionic (v18.04.4).
I have installed Java versions 8 and 11 (openjdk) along with source code.
I have also installed javaFx versions 8 and 11 with source code.
I have even gone to "Tools -> Java Platform Manager" and ensured that v8 and v11 of Java are properly installed along with the appropriate "Platform Sources".
But I still get the error mentioned when I try to create a new JavaFX project.
Any help would be very much appreciated.NetBeans JavaFX project create error
I have never tried to use JavaFX on openJDK, try out with Oracle JDK, as far as I know this is the best choice for using JavaFX, also try to edit the default platforms to match the appropiate system paths

Eclipse not showing Java 9 options

I downloaded the last Oxygen (3A) package from March 18' in order to trying Java 9. Using this tutorial, I was trying to get a grasp on the module.
However, in this tutorial, there is a checkbox that I do not have, while adding a source folder to a Java project:
[X] Create module-info.java (9 or higher)
I tried to get some patch on Java 9 compatibility for Eclipse, but failed. Indeed, on this page, the following message is shown to the user:
Note: This feature patch is disabled. It was originally intended to be installed on top of 4.7.1 builds.
The Help > About Eclipse window displays the following info:
Version: Oxygen.3a Release (4.7.3a)
However, it seems that it is not the case. I already installed a JDK 9 on my computer, and set those lines in my eclipse.ini file:
-vm
C:\Program Files\Java\jdk-9.0.4\bin\javaw.exe
-vmargs
--add-modules=ALL-SYSTEM
So Eclipse should run with Java 9 and give me the right options.
Am I missing something ? It looks not logical to me that they would remove this kind of checkbox.
It doesn't look like that option actually made it in to the Eclise Oxygen final releases. According to bug report 525374 it should be in Eclipse Photon (4.8).
You can create the module-info.java by right clicking on the Project and selecting 'Configure > Create module-info.java'.

NetBeans 8.2 create not project

I am sure it is simple problem, but I am new to Java and PHP, I want to learn Java, I bought a book, I have also a couple of books as PDF from internet, at the Beginning of the book there is always intructions, how you can install for example NetBeans to start programming. I have installed jdk 8 and NetBeans 8.2.
The problem is, when I start NetBeans, the Buttons for creating new Project not function and is not reacting on my click. I have installed all plugins. I have searched the internet. I have found, that I should click create new Project, I will get a dialogue, then I should choose the desired project. But it shows nothing when I click that button, it simply does not react. Please help me.
It might have been caused by JDK 9. You could have changed the JDK 9 to previous version and it would have worked.
For that you would have to go to:
\NetBeans 8.2\etc
Then you can edit: netbeans.conf . Just change the directory for JDK from 9 to previous version if it is installed. (or install JDK 8 and then do the same process)
I have uninstalled the NetBeans 8.2, which I downloaded it alone from NetBeans website, after that I have downloaded it as a complete package together with Java SDK from Java website, now it functions wonderful
Netbeans 8.2 is bundled with Oracle JDK 8. Just download the installer for your platform and install it. I have tested the installer with Windows 10 and it works like a charm.

can not use javafx on intellij idea

I have problem importing import "javafx.util.Pair" into my program.
after searching the net I've found this answer cannot resolve symbol javafx.application in IntelliJ Idea IDE and I've installed desired jar file but still I've problem to import.
this is what I face to when open java jdk.
I don't know the why the "jfxrt.jar" is different.
note the black arrow on the folder icon
open the File | Project Structure dialog, there under Platform Settings select SDKs and then your JDK 1.8. On the right you then see all the jars that make up the classpath to your SDK. Make sure that your jfxrt.jar is in that list, if not, you can add it by clicking the '+' button at the bottom.
Update May 2020
JavaFX is no longer part of the Oracle or OpenJDK default distributions. Instead it is available as a seperate library or module set.
For instructions on using JavaFX in your application, see the documentation at:
https://openjfx.io
For instructions on working with a modern JavaFX installation and Idea, also see the related question:
IntelliJ can't recognize JavaFX 11 with OpenJDK 11
You don't need to "install the desired jar" (whatever that means).
You don't need to do that for JavaFX. You should not do anything explicitly with jfxrt.jar either in the filesystem or by adding it to a project classpath. If doing something on the filesystem, that is especially bad as jfxrt.jar is not made to be standalone and requires related native libraries shipped with the JDK in order to work.
The JavaFX code should be part of the JDK installation you are using. Perhaps you are using a Java version below 8 or an OpenJDK implementation that does not include JavaFX. If so, then install the Oracle JDK 8+ and set idea to use it. Everything should just work then and all of related JavaFX imports will resolve.

How to see source code of JavaFX SDK in eclipse kepler?

I decided to learn JavaFX. I need to browse source code of classes like javafx.scene.layout.StackPane .
So I pressed F3 to go to source code. There is no source code and no button that allows to attach source code.
I looked in the Internet and din't find anything helpful.
I use eclipse kepler and java7.
I have jfxrt.jar in my classpath.
For Java SE 8, the JavaFX source code is distributed with the JDK. If Eclipse does not pick it up automatically, you need to select the zip file using the standard "Attach Source" approach. The file is called javafx-src.zip and is located alongside src.zip in the root of the unpacked Oracle JDK (on Windows).
Recommended - use Java 8 + e(fx)clipse
I believe if you use the recommended e(fx)clipse plugin for JavaFX development and a recent Oracle (Java 8+) JDK, then the Eclipse IDE will automatically be configured to be aware of the JavaFX sources.
Otherwise manually attach sources
If this doesn't work for you, then you can follow JodaStephan's suggestion of attaching sources manually.
For Java 7 users
If you must use Java 7 rather than Java 8, then full source won't be available as JavaFX was only fully open sourced for Java 8. However, you can view some of the source by manually downloading the source code as described at: Where can I download the JavaFX 2.2 source code?, then manually attaching sources. I do not recommend use of Java 7 for JavaFX development or runtime as there were many bug fixes and improvements in Java 8 which are not ported to Java 7.
Disclaimer
I'm not an Eclipse user and haven't tried some of these options.

Categories

Resources