netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Netbeans 26 does not recognize kotlin gradle projects until gradle editor support is manualy activated

Open eheimburg opened this issue 7 months ago • 3 comments

Apache NetBeans version

Apache NetBeans 26 latest release candidate

What happened

After installing NetBeans 26, I chose File->Open Project and navigated to the folder with my project. But it wasn't recognized as a project folder; I couldn't open it.

I tried creating a brand new gradle application project (using java 24), and this project DOES show up as a valid gradle project.

Comparing the old and new project, I noticed that my project uses kotlin (and hence has a settings.gradle.kts file) whereas the newly-created project has a settings.gradle file. So it seems the problem is related to kotlin-specific gradle projects.

To test this, I created a zero-byte file named settings.gradle. Upon doing this, NB26 does detect the project and can open it correctly.

So the issue doesn't seem to be with processing kotlin gradle projects, just detecting them.

(Unfortunately the command-line gradlew application doesn't like having that empty settings.gradle file there and generates errors; I'm still trying to find a setup that works for both NB26 and the command line.)

Language / Project Type / NetBeans Component

Gradle

How to reproduce

Attempt to open a Gradle project that has a settings.gradle.kts file instead of a settings.gradle file

Did this work correctly in an earlier version?

Apache NetBeans 25

Operating System

Windows 11 24H2

JDK

Java 11, Java 24

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

  • I have tried both the binary zip and the "Friends of Netbeans" windows installation, same behavior in both.
  • The project in question uses gradle 8.13

Are you willing to submit a pull request?

No

eheimburg avatar May 23 '25 00:05 eheimburg

can you open tools -> plugins -> installed check if the "Gradle Editor Support" and "Kotlin Editor" modules are active?

I noticed that my project uses kotlin (and hence has a settings.gradle.kts file) whereas the newly-created project has a settings.gradle file.

btw the gradle project wizard has a combo box which lets you select between groovy and kotlin

mbien avatar May 24 '25 02:05 mbien

can you open tools -> plugins -> installed check if the "Gradle Editor Support" and "Kotlin Editor" modules are active?

Hm, I don't see any plugins with those names, either in Installed or Available Plugins. The Installed tab has only "Java SE" and "Tools" active.

btw the gradle project wizard has a combo box which lets you select between groovy and kotlin

Oh, I hadn't seen that! I made a new kotlin project, and NetBeans does detect that project correctly.

... wait, actually, NB 26 now detects my old project correctly. I guess it's fixed...!

I'd tried the usual voodoo (reboot, reinstall, clear cache) a few times before, so I'm not sure what's made the difference. I've just tried deleting the project's and NB's temporary files, and it seems to work out of the box now, where it didn't before.

If I am able to reproduce the problem in the future, I will reopen with more info.

eheimburg avatar May 31 '25 04:05 eheimburg

lets keep this issue open. I will rename it slightly to clarify

using NB with a fresh config has all features disabled but they should activate on project/file open

  • it seems Kotlin support does not activate when a kotlin file is opened in the editor
  • Kotlin based gradle projects are not visible as gradle projects until the Kotlin/gradle support modules activate, thats why you thought you couldn't open the project

mbien avatar May 31 '25 17:05 mbien