Netbeans Installation cannot find JRE - netbeans

I am trying to install Netbeans 8.2 on my Microsoft surface pro and I am using JDK 10.0.2. When I run the Netbeans installer it is unable to find the JDK. So I used the --javahome command with the correct file destination and I suppose it finds the JDK. But then it throws the same error for the JRE. I do not know why the JRE cannot be found. I have been reading many similar questions and am seeing directions saying to use JAVA_HOME and set the environment variables. I am very unfamiliar with the windows command prompt, so I would appreciate a more specific solution.

As much as I know, JDK doesn't come with JRE, so check in your Java folder if you got JRE installed, if not, try downloading it manually.
Hope that helps

Version 8.2 of NetBeans does not support JDK 10.
However, ownership of NetBeans has recently been moved from Oracle to Apache and you can use JDK 10 with NetBeans 9.0 RC1 (RC = "Release Candidate").
Just download the zip file, unzip it and then locate and run netbeans64.exe (or netbeans.exe for 32-bit) within the unzipped folder. Those steps are the same regardless of operating system.
When NetBeans starts it should automatically locate your installed JDKs, but verify that you have JDK 10 included as a Java Platform from the Tools > Java Platforms screen:
You can explicitly add JDK 10 to NetBeans if necessary:
Tools > Java Platforms
Click Add Platform and complete the wizard to add JDK 10.
Once you have JDK 10 included in Java Platforms you can create a trivial Java 10 project, although the process is not completely intuitive:
File > New Project > Java > Java Application
Accept all the default options. A new project with a name of the form JavaApplication{n} will be created.
In the Projects panel select the project's node, right click and select Properties from the popup menu.
Select Libraries from the list of Categories and set Java Platform to JDK 10.
Select Sources from the list of Categories, set Source/Binary Format to JDK 10 and click OK.
You now have a Java 10 project. To verify that, make sure that the following code compiles as your main() method:
public static void main(String[] args) {
var v = 7;
}

Related

Installing J2ME plugins in NetBeans 12.4

I downloaded J2ME plugins from here: https://www.oracle.com/java/technologies/javame-sdk-downloads.html
I can't install the plugins, this is the error:
Some plugins require plugin Java Profiler Core to be installed.
The plugin Java Profiler Core is requested in version >= 2.1.1 (release version 2) but only 3.41 (of release version different from 2) was found.
The following plugins are affected:
    Java ME SDK CPU Profiler Snapshot Viewer
    Profiler (Java ME Projects Support)
Please help me, thank you
First a couple of basic points:
I don't know whether Java ME works with NetBeans using a JDK version > 8 so I first set the default platform for NetBeans to JDK 8. This step may not be necessary, but it definitely works.
Do not download the NetBeans plugins from the Oracle page you linked to. Instead, use the approach detailed below to use older plugins which are compatible.
In NetBeans 12.4:
Go to Tools > Plugins > Settings and click Add to add http://updates.netbeans.org/netbeans/updates/8.2/uc/final/distribution/catalog.xml.gz as an Upgrade Center, then check the Active column for its entry.
Click the Available Plugins tab. You should see four entries for Java ME. Click the Install checkbox for all four, then click the Install button to install those plugins:
Next download oracle-jmesdk-8-0-rr-win32-bin.exe from the Oracle page you linked to, then run the downloaded executable to install the Java ME SDK to a location of your choice (if you haven't already done that).
Add the ME JDK you just installed as a Java Platform within NetBeans using Tools > Java Platforms > Add Platform.... The exact steps are detailed in the update at the end of this answer to How to fix Netbeans 8.0 not detecting Java ME.
So Java ME SDK has been added as a Java Platform, and the older Java ME... plugins have been installed. The final step is to verify that you can now use the Project Wizard to create a Java ME Embedded Application in NetBeans 12.4:
Select Files > New Project... and you should see a new entry in the list of Categories list titled Java ME Embedded. In the Projects list there will be a single entry titled Java ME Embedded Application:
Click Next >, and you should see a screen similar to this:
Set the Project Name field, and any other fields, as necessary.
Finally, click Finish to create the Java ME project.

MyEclipse doesnt accept JDK for creating Runtime

I am trying to create a JBoss Runtime in Eclipse. I have added 2 JRE entries in my Eclipse - one for JDK1.7 and another for 1.8.
Still Eclipse wont identify my 1.7 entry. See screenshots attached.
P.S: I got my JDK 1.7 by extracting the MSI/Exe setup file using 7 zip. I have done regular installation of Java 1.8 and My Java_Home is set to 1.8 in the PC. I don't want to modify it to point to lower version as it will impact other projects.
Your JRE definition won't be recognized as valid for the JBoss runtime if it is not a JDK. Your extraction of the JDK may have resulted in a JRE instead. Why not just run the JDK installer and change the installation folder to something other than your Program Files folder; it won't switch your system to Java 1.7 that way (I just tried this myself to check). Then define a new JRE to point to the newly installed JDK 1.7 and you'll be able to use that for the JBoss runtime.

NetBeans 8.2 does not open on Mac OS

I am trying to start NetBeans 8.2 on a Macbook Pro and it's not working.
It shows the splash screen, then after a while it shuts down without starting anything.
Running from the command-line I can see this error:
Oct 02, 2017 7:40:28 PM org.netbeans.ProxyURLStreamHandlerFactory register
SEVERE: No way to find original stream handler for jar protocol
java.lang.reflect.InaccessibleObjectException: Unable to make field transient java.net.URLStreamHandler java.net.URL.handler accessible: module java.base does not "opens java.net" to unnamed module #7823a2f9
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:337)
at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:281)
at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:175)
at java.base/java.lang.reflect.Field.setAccessible(Field.java:169)
at org.netbeans.ProxyURLStreamHandlerFactory.register(ProxyURLStreamHandlerFactory.java:82)
at org.netbeans.JarClassLoader.<clinit>(JarClassLoader.java:141)
at org.netbeans.MainImpl.execute(MainImpl.java:178)
at org.netbeans.MainImpl.main(MainImpl.java:85)
at org.netbeans.Main.main(Main.java:83)
Looks like Java 9 got bundled with it and it's causing an error. The documentation implies that NetBeans 8.2 uses JDK 8!?
How to use my own java to run NetBeans, or how to get NetBeans to start without this error?
Yes, NetBeans 8.2 does use JDK 1.8, and specifically does not support JDK 1.9.
It's unclear from the OP which version of Java is desired to run with NetBeans, but the version of NetBeans to use is governed by the version of Java to be used:
[1] For Java 8, use Netbeans 8.2. Note that Java 9 is not supported. You can download NetBeans 8.2 bundled with JDK 8u141 for Mac OS here:
http://www.oracle.com/technetwork/articles/javase/jdk-netbeans-jsp-142931.html
Once it has been installed it no specific configuration for Java should be necessary.
[2] For Java 9 you must use a Development Build of NetBeans. That can be downloaded from http://bits.netbeans.org/download/trunk/nightly/latest/ but be sure that Mac OS X is selected from the Platform drop list before clicking Download.
For any version of NetBeans you can specify your own version of Java as follows:
Start NetBeans and select Java Platforms from the Tools menu.
Click the Add Platform... button.
Complete the wizard to locate the version of Java you want to use.
One final point: there is no problem having multiple versions of NetBeans installed and running concurrently using different JDKs, typically NetBeans 8.2 with JDK 1.8 and NetBeans Dev Build with JDK 1.9.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update:
If NetBeans closes itself down on startup it may have an invalid JDK path. To change the JDK that NetBeans uses:
Locate the file netbeans.conf. It should be in the etc directory under the NetBeans installation directory.
Edit that file in a text editor. Locate the line containing the property netbeans_jdkhome. On my Windows 10 installation it looks like this:
netbeans_jdkhome="C:\Java\jdk1.8.0_121"
Change the value for that property to specify the path to the desired JDK, save the file and restart NetBeans.
As pointed in the comments:
I had tried to set netbeans_jdkhome in /Applications/NetBeans/NetBeans\ 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf to point to JDK 10, but still it did not work.
I had to install JDK 8, and set netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home"
Uninstalling JDK 10 and using JDK 8 worked for me and setting netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home" worked quite well.
macOS 10.13.5
JavaJDK 10 installed as "System" JVM
I was able to install NetBeans, but unable to get it to function. Window would open, clicking on "New Project" or "New File" did absolutely nothing.
Was able to get it working (all modules and servers) by going into the configuration file at
/Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
and editing the commented out path to JDK at the bottom of the file!
Cheers!
Check Java JDK is installed on Mac, NetBeans 8.2 does use JDK 1.8(Java SE 8)
/usr/libexec/java_home -V
Matching Java Virtual Machines (2):
12.0.1, x86_64: "Java SE 12.0.1" /Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home
1.8.0_211, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home
if not , just install (no need remove exist JDK)
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
modify /Applications/NetBeans/NetBeans 8.2.app/Contents/Resources/NetBeans/etc/netbeans.conf
netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk1.8.0_211.jdk/Contents/Home"
For NetBeans 8.2 JDK 1.8 should be used. If you installed JDK 1.9 or JDK 10.0 to your MacBook, you must uninstall that from your computer.
I had the same issue. I'm using Apache Netbeans 12.0 so I had to change my OpenJDK version from 19.0 to 14.0 and update the path in order to finally work.
No need to uninstall the 19.0, just install the version that works with the Apache that you have and update the path:
netbeans_jdkhome="/Library/Java/JavaVirtualMachines/jdk14.0.jdk/Contents/Home"

Netbeans - Can not install jdk 1.9.0 Build b53

I'm trying to install jdk 1.9.0 early release package to be used with NetBeans 8. I realized that jdk is installed without private jre (there is no jre folder inside of jdk1.9.0 folder). And Netbeans don't work . In Java Platform Manager after selecting jdk1.9 field under Class tab contains no platform classpaths.See picture below.
jre1.9.0 folder is installed only as a seperated folder.
What can I do about it so I could compile and run my programs?
There will not be jre folder in JDK 9, as it is restructured. Plus you don't really need it as JDK has all files to compile and execute code.
As internal files of JDK and format are changed too, any IDE will not work, until it is updated to Java 9 support.
NetBeans9.0 is planned to be supporting JDK9 and JPMS.
You can though get started to use Java9 modules with the Early Access build of the same.
There is a confluence wiki to keep track of the new and noteworthy features marked to be exposed with the GA release of NetBeans.

JDK on OSX 10.7 Lion

I've instaled the Java for Developer package provided from Apple for 10.7 and java apps are running fine
but eclipse cannot find the JDK root path and I cant either.
Anybody any ideas?
You can download the 10.7 Lion JDK from http://connect.apple.com.
Sign in and click the java section on the right.
The jdk is installed into a different location then previous. This will result in IDEs (such as Eclipse) being unable to locate source code and javadocs.
At the time of writing the JDK ended up here:
/Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home
Open up eclipse preferences and go to Java --> Installed JREs page
Rather than use the "JVM Contents (MacOS X Default) we will need to use the JDK location
At the time of writing Search is not aware of the new JDK location; we we will need to click on the Add button
From the Add JRE wizard choose "MacOS X VM" for the JRE Type
For the JRE Definition Page we need to fill in the following:
JRE Home: /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home
The other fields will now auto fill, with the default JRE name being "Home".
You can quickly correct this to something more meaningful:
JRE name: System JDK
Finish the wizard and return to the Installed JREs page
Choose "System JDK" from the list
You can now develop normally with:
javadocs correctly shown for base classes
source code correctly shown when debugging
On newer versions of OS X you should find ALL JREs (and JDKs) under
/Library/Java/JavaVirtualMachines/
/System/Library/Java/JavaVirtualMachines/
the old path
/System/Library/Frameworks/JavaVM.framework/
has been deprecated.
Here is the official deprecation note:
http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdate3LeopardUpdate8RN/NewandNoteworthy/NewandNoteworthy.html#//apple_ref/doc/uid/TP40010380-CH4-SW1
I have just ran into the same problem after updating. The JRE that is downloaded by OSX Lion is missing JavaRuntimeSupport.jar which will work but can wreck havoc on a lot of things. If you've updated, and you had a working JDK/JRE installed prior to that, do the following in Eclipse:
1) Project > Properties > Java Build Path > Select broken JRE/JDK > Edit
2) Select "Alternate JRE"
3) Click "Installed JREs..."
4) In the window that opens, click "Search..."
If all goes well, it will find your older JRE/JDK. Mine was in this location:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home
For Mountain Lion, Apple's java is up to 1.6.0_35-b10-428.jdk as of today.
It is indeed located under /Library/Java/JavaVirtualMachines .
You just download
"Java for OS X 2012-005 Developer Package" (Sept 6, 2012)
from
http://connect.apple.com/
In my view, Apple's naming is at least a bit confusing; why "-005" - is this the fifth version, or the fifth of five installers one needs?
And then run the installer; then follow the above steps inside Eclipse.
You can download jdk6 here http://support.apple.com/kb/DL1573
Wish it helps