Apache NetBeans IDE 12.0 cannot create new java application - java

I installed Java NetBeans IDE 12.0 and JDk-16. When I try to create a project using Java With Ant, it get stuck like in the screenshot. When I cancel it, it creates the file but no code in it i.e., no main method is created. Just a blank file.
Does anyone know how to solve this?

From the NetBeans documentation for "Deployment Platforms" for NetBeans 12.0:
Apache NetBeans 12.0 runs on the JDK LTS releases 8 and 11, as well as
on JDK 14, i.e., the current JDK release at the time of this NetBeans
release.
NetBeans may work (or appear to work) with newer JDK releases that are not officially supported such as JDK 16, but you run the risk of hitting unexpected problems.
So if you don't need any Java features released after JDK 14, download and install JDK 14, and add it as a Java platform in NetBeans, using Tools > Java Platforms > Add Platform.... You don't need to uninstall JDK 16.
However, if you really need JDK 16 features then use a different IDE. The latest release of Eclipse, 2021-03, explicitly supports JDK 16.

I had the same problem and was able to solve it in windows by following the steps below:
Uninstall Netbeans 12.4. Make sure to delete all the cache files
(Drive:\users\user\AppData\Roaming\Netbeans and
Drive:\users\user\AppData\Local\Netbeans) (Windows)
Check your JDK 16 directory (no JRE) and environment variables JAVA_HOME, CLASSPATH and PATH.
Install Netbeans 12.4
Create new project and check that you select Download and activate nb-javac.

For me it helped using NetBeans version 12.5 and the JDK 14. After that everything was running smooth.

I had the same problem and upgrading to version 12.5 worked for me.

Related

How to fix error while installing NetBeans?

I have installed Java and am trying to install NetBeans 11.3 on my Windows 10 but after I ran the exe. installer, an error message popped up:
An unexpected exception happened in thread main
java.lang.NoClassDefFoundError java/util/jar/Pack200
NetBeans have problems with the jdk-14, because I suppose that you have install the jdk-14 so uninstall it and try it with the jdk-13.0.2.
Sorry, but in my opinion is to install an old version from Java no solution, just because it works. When someone has problems with his Firewall, simply disable the Firewall would also be no solution.
https://www.java.com/en/download/faq/other_jreversions.xml
We highly recommend users remove all older versions of Java from your
system. Keeping old and unsupported versions of Java on your system
presents a serious security risk. Removing older versions of Java from
your system ensures that Java applications will run with the most
up-to-date security and performance improvements on your system.
The "real" solution would be a reprogramming of the NetBeans installer.
This used function was suggested for deprecated on 2018-04-04, which was done on 2018-08-23.
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8200752
The removal was suggested on 2019-10-08, which was done on 2019-12-18.
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8232022
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8232022
We assume that developers who rely on Pack200 have had enough notice about its proposed removal to make alternative arrangements. … We assume that developers who use pack200 to shrink application JARs can switch to either the jlink tool or the jpackage tool to create application-specific runtimes with an optimized form factor.
edit: I solved it this way.
uninstalled JDK 14
installed JDK 13.0.2
installed Apache NetBeans
installed JDK 14
open C:\Program Files\NetBeans\netbeans\etc\netbeans.conf and changed path to JDK
uninstalled JDK 13.0.2
Now NetBeans runs with the JDK 14.
Yes, I got it working as follows from cmd, when referring to older version:
Apache-NetBeans-11.3-bin-windows-x64.exe --javahome "C:\Program Files\Java\jdk-12.0.2"
The https://netbeans.apache.org/download/nb113/nb113.html site now has this
memo:
The installers will not run under JDK 14 because usage is made of the Pack200 Tools and API, for packing and unpacking, which is removed in JDK 14, see JEP 367.
If several JDK versions are installed, then you need to define the environment variable "JAVA_HOME" where to set the path to JDK-12.
Details are described here. (Only in Russian)
An alternate way to Andy's.
(Windows)
1) Right click on "Apache-NetBeans-11.3-bin-windows-x64" installer and select "Create shortcut".
2) Right click on the created shortcut and select "Properties".
3) In the "target" textbox, add your under 14 JDK version path at the end, here is how mine looks like:
C:\Users\userfoldername\Desktop\Apache-NetBeans-11.3-bin-windows-x64.exe --javahome "C:\Program Files\Java\jdk-13"
4) Press Ok when done, double-click on the shortcut and it should install fine now.
Switching to openJDK 12 worked for me too. But instead of uninstalling JDKs or manually changing the env, I use Sdkman.io which works like Node version manager if you have used that. It manages your JDKS for you and offers downloads of different versions (Open, Zulu, Graals) and will switch between them with with just a quick command.
I found a nice solution in 3 steps:
check all versions of the JDK path in Environment variables, if there is an outdated path please remove it and keep the latest version of the Java JDK bin path.
after the second step, please uninstall the Netbeans and re-install the latest version.
Netbeans will found the latest JDK path in case it was jdk14 and choose JDK latest version path for NetBeans.
solved
Just install JRE from oracle. Everthing will run fine. I have the same issue

NetBeans Installation

Is it true that just JDK version 7 could be used to install NetBeans IDE 8.0.2?
On my device, I have been installed the last version of JDK, but while I am installing Netbeans, a message appeared to tell that I have to install JDK. In other words, Netbeans didn't recognize that there is already a JDK and successfully installed !!
NetBeans 8.0 runs just fine with Java 8.
If NetBeans doesn't detect or find your JDK, you can always provide the location on the command line when starting NetBeans, e.g.:
netbeans64.exe --jdkhome c:\Java8
I have never used the NetBeans installer, but I think you can pass that parameter to the installer as well.
Once, installed, you can also edit conf/netbeans.conf and un-comment the line #netbeans_jdkhome="/path/to/jdk" and make it point to your JDK:
netbeans_jdkhome="c:\Java8"
The Java SE Development Kit (JDK) 7 Update 10 (or later) or JDK 8 is required to install NetBeans IDE.
As seen on NetBeans 8.0.2 Installation Instructions it seems you really have to be on JDK 7 or 8.
While installing one of those versions, remind yourself to set the PATH variable.

Installing NetBeans 8.0.2 with JDK 9.0.1

When I try to install NetBeans 8.0.2 on my PC (Win10-64bit) I get the error message:
despite that I already installed JDK 9.0.1, as evident in the command prompt:
My path variables are set as follows:
AFAIK Netbeans which supports JDK 9 is yet to release (i.e, Netbeans 9.0 which is in development mode).
And the documentation states this.
By: jkovalsky, 09 Oct 2017
If you have downloaded JDK 9 recently and try to convince your NetBeans 8.2 IDE to run on top of it we will probably disappoint you, because 8.2 version is not designed to work with JDK 9.
In order to use JDK 9 happily you will need to download a NetBeans 9.0 development build from Apache Incubator. For more information please read Geertjan Wielenga's post on Using Apache NetBeans IDE.
Thank you!
NetBeans team
I've also faced the same issue with Netbeans 8.2 (but you're trying with Netbeans 8.0.2). So, I installed JDK 8 and the Netbeans installation went fine.
Still if you want to use JDK 9 you can install it alongside with JDK 8. But you need to set JDK path as JDK 8 in the system path (like you did for JDK 9). While installing Netbeans select JDK 8 installation path as JDK for Netbeans.
I hope it'll be helpful.
As mentioned, you are getting error when trying to install NetBeans, in that case you can specify the JDK at command line
<netbeans_installer>.exe --javahome "C:\Program Files\Java\jdk1.9.0"
FaqSuitableJvmNotFound

Have Java 8 for Luna and Java 7 for Juno

I want to use both Eclipse Juno and Eclipse Luna simultaneously in my machine, for different projects.
My machine has Java 8 installed. This works perfect with Luna since the projects I have in Luna are exclusive to Java 8.
My projects in Juno need Java 7 strictly. It seems I have a build path issue (I guess it is because I don't have Java 7 in my system).
I downloaded JRE 7 and tried to install it. However, it tells me that I already have Java 8 installed in my machine.
What do I do then? How can I have Java 7 for my Juno projects?
Mac OSX Mavericks.
You can specify in the eclipse.ini file which JVM you want to use.
The JVM does not even need to be installed, it is enough to unzip it to some folder.
Simply create an entry like this:
-vm
C:\Java\JDK\1.6\bin\javaw.exe
See also:
https://wiki.eclipse.org/Eclipse.ini
In Eclipse you can add the JVMs without having them installed as well:
Windows / Preferences / Java > Installed JREs
If you would be doing development with Java 7, you need the JDK as opposed to the JRE.
In Eclipse, you make your project FACETED, then right click on your Java 7 project and go Properties. From there, you can select Project Facets and then you can modify the Java version you would be using for that particular project.
I have multiple Java versions (JDKs) installed and this is how i control the version i am using in my projects.
Hope this helps!

Netbeans 6.9.1 not working on windows 8

I want to make Java Desktop Application but Netbeans 6.9.1 is not working on windows 8.1 (it crashes on double click to run). I have installed JDK8 along with Jre7 (both 32 and 64 bit). How to make it run, Netbeans 8 is working properly.
Netbeans 6.9.1 is not working on windows 8.1
You must have JDK 6.0 on your system to install and run NetBeans IDE 6.9.1.
Source NetBeans IDE 6.9.1 Release Notes.
To make Netbeans run on JDK 6, if you have more than one JDK do this:
You can change the JDK for Netbeans by modifying the config file:
Open netbeans.conf file available under etc folder inside the NetBeans
installation. Modify the netbeans_jdkhome variable to point to new JDK
path, and then Restart your Netbeans.
Sample
# Default location of JDK, can be overridden by using --jdkhome <dir>:
#netbeans_jdkhome="C:\Program Files\Java\jdk1.8.0_45"
netbeans_jdkhome="C:\Program Files\Java\jdk1.6.0_45"
mainly the problem is that your netbeans and jdk are not compatible. you should download lastest jdk 8 and netbeans which you can from here.
DONT FORGET TO SET PATH.
I got a Solution
You must have JDK 6.0 on your system.
Then SET PATH at time of installation to JDK 6.0 .

Categories

Resources