apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.55k stars 813 forks source link

NetBeans 21 ends up in broken state if you activate some IDE features via Options panel before creating a new project #7091

Open iajn opened 1 month ago

iajn commented 1 month ago

Apache NetBeans version

Apache NetBeans 21 (not selectable in the dropdown)

What happened

On the new NetBeans IDE 21 if you end up activating some IDE features via Options panel (e.g. by selecting the Java tab, which activates Tools) the IDE ends up in a broken state. In this state trying to create e.g. a new Maven project fails after selecting the project type, you first get "Configuring java cluster" and afterwards it briefly flashes "Activating Java SE" before ending up on an empty screen with title "Finding Feature".

Creating a new project (e.g. Maven -> NetBeans Platform application) on a fresh installation before accessing any of the options menus circumvents the issue and the project is created correctly.

Once the IDE ends up in the broken state it doesn't seem possible to recover by restarting the IDE, unless you clear the caches manually first.

I'm using Windows 11, reproduced the issue using both JDK 21 (prepackaged with the community installer) and JDK 17 (JetBrains). (Side note, seemed like the community installer didn't configure the prepackaged JDK correctly, so I added the jdkhome manually to the netbeans.conf file.)

Also tried the standard installer and binary zip, same issue. Cleaned up old caches and userdirs between attempts.

On my previous NetBeans installation (20-rc1) the issue doesn't appear.

Language / Project Type / NetBeans Component

Java / Maven

How to reproduce

After fresh install on Windows 11, access Java options panel before doing anything else. Afterwards creating new Maven projects fails.

Did this work correctly in an earlier version?

Apache NetBeans 20

Operating System

Windows 11

JDK

Prepackaged JDK 21.0.2; OpenJDK 64-Bit Server VM 21.0.2+13-LTS

Apache NetBeans packaging

Apache NetBeans provided installer, Apache NetBeans binary zip, Third-party package

Anything else

Here is a log of me opening the IDE, clicking the Java tab in the options menu, trying to create a NetBeans Platform Maven project, trying to create an empty pom project, and closing the IDE. There are some repeating warnings (below) and some error after the system gives up.

WARNING [org.netbeans.modules.ide.ergonomics.newproject.DescriptionStep]: There is still wrong iterator org.netbeans.modules.ide.ergonomics.newproject.FeatureOnDemandWizardIterator for file object MultiFileObject@59784d9e[Templates/Project/Maven2/org-netbeans-modules-maven-apisupport-NbmWizardIterator-createNbAppIterator]

messages.log

Are you willing to submit a pull request?

No

neilcsmith-net commented 1 month ago

Can replicate on Ubuntu. You can use Tools / Plugins / Installed and select Java SE and Activate. Also from the Start Page, click Activate Features to get to the same place.

This is a little annoying. Ergonomics causes too many issues. Not sure what the cause is here.

(Side note, seemed like the community installer didn't configure the prepackaged JDK correctly, so I added the jdkhome manually to the netbeans.conf file.)

I assume you're not using the created shortcut? Directly running netbeans(64).exe will not work correctly.

iajn commented 1 month ago

You can use Tools / Plugins / Installed and select Java SE and Activate.

Right, this fixed the issue.

I assume you're not using the created shortcut? Directly running netbeans(64).exe will not work correctly.

Yes, my bad. I was indeed mostly using the exe directly. I did check if the shortcut sets the jdkhome flag before creating the issue, but I think I mistakenly checked it from the shortcut created by the standard installer since I tried both.

mbien commented 1 month ago

the last big change in that area was https://github.com/apache/netbeans/pull/6355 AFAIR however, since you said:

On my previous NetBeans installation (20-rc1) the issue doesn't appear.

this would indicate that this isn't the cause, since it would have been in NB 20 already at this point.

However, i remember while testing the PR above, I already saw some weird behavior in NB 19 and before: https://github.com/apache/netbeans/pull/6355#issuecomment-1758959915

mbien commented 2 weeks ago

found another way how to break it:

ebarboni commented 3 days ago

for NB23

neilcsmith-net commented 3 days ago

@ebarboni why? This should be checked and still open for fixing after branching if a cause is found. No need to move the milestone on any bugs at this stage.

ebarboni commented 3 days ago

if issue is found during the rc and release preparation milestone could be set to back 22 but. I try to reduce the list of item in milestone nb22 to have idea what to look at.