Re: NB 12.6, OpenJDK 17: Cannot refactor XXX.java that is defined outside of an open project.

2021-12-13 Thread * William
Good afternoon Netbeans folk,

I trust you are well.  I have a plea in a manner of speaking.  I seem to be
needing to do this manually all the time recently, and I would expect an
smart IDE to just remember my setting(s).  Let me begin.

On the command line when I execute a gradle build command it respects the
JDK specified in the project's gradle.properties file.

   - org.gradle.java.home= /prod/lib/java/jdk/v01.08
   - From all project directories.  Presumably the gradle model sets the
   compiler for al subprojects.

We need Java 9+ (I have Java 17, currently) to run netbeans and that
becomes the default "Java Platform" when a Gradle project loads.  Not the
platform specified and respected by Gradle.  As this is so, I must change
teh platform manually, everytime I open the IDE and load a Gradle project.
That is not all, I can use build all to run JDK 1.8 for everyone.  When I
need build, test  or debug individual sub-projects I am required to
manually set the compiler property for EVERY project I need to use,
manually as shown.  It is extremely tedious.

[image: image.png]

As far as I know, there's no setting that I can set in a config file to
persist this IDE setting.  I've even tried trolling in the user directory
in the netbeans config.

Because I'm doing Gradle builds, using *gradlew* from Netbeans, I expect
the IDE build to be identical to the command line:

   - *./gradlew build  *

And it is NOT without the manul intervention described.  I consider that to
be a bug in the gradle handling myself.

Questions:

   - Can I set this option persistiently?  Where?
   - Can the setting be root project wide and persistient?
   - I'm ok if I have to specify the JDK for each subproject I can do
  something in groovy/gradle for that.
  - Why doesn't Netbeans honour the Gradle settings?  Is this just an
   oversight or a policy choice?

Sorry if I'm terse today I have to leave the office now and I'm in a rush.
Looking forward to any thing that helps?

Kind regards,

\_/\_/


Netbeans 12.6, browsing for superclass does not show project files

2021-12-13 Thread Jim Mayer
Hi all,

I'm still trying to put together a test case for the refactoring issue I
ran into, but here's one for the other problem I saw. This is a link to a
Google Drive folder, where I've uploaded the test case and some other
information.

https://drive.google.com/drive/folders/1sXKairwilsOrTMJcIch9oCw8VQe1sEAx?usp=sharing

If it seems appropriate, I can create a JIRA issues for this, but I haven't
used NetBeans in years, so thought I'd share the problem first.

>From the README.txt:

PROBLEM DESCRIPTION
When creating a new class browsing for a superclass does not show project
files.

HOW TO REPEAT

(1) File>New Project...>Java with Gradle>Java Class Library
(2) Create a new class named "Fruit" (see the attached tar file for what I
did).
(3) Browse to the source package containing the new file.
(4) Right click on the package and select New>Java Class
(5) Where the dialogue says "Superclass", click on Browse...
(6) Under type name, write "Fr"
(7) The "Types Found:" on my system shows Frame, FameNode, FramesDecoder,
etc. but do not include "Fruit".

ATTACHED FILES

messages.log
The "messages.log" file from my system.

netbeans-class-browsing-issue.tar.gz
The entire project directory directory.

README.txt
This file.

screenshot-showing-problem.png
A screenshot showing the names I saw after following the above steps.

NETBEANS CONFIGURATION

Product Version: Apache NetBeans IDE 12.6
Java: 17.0.1; OpenJDK 64-Bit Server VM 17.0.1+12-Ubuntu-120.04
Runtime: OpenJDK Runtime Environment 17.0.1+12-Ubuntu-120.04
System: Linux version 5.4.0-91-generic running on amd64; UTF-8; en_CA (nb)

SYSTEM CONFIGURATION

Ubuntu 20.04.3 LTS
% uname -a
Linux chill 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021
x86_64 x86_64 x86_64 GNU/Linux

-- Jim


Re: NB 12.6, OpenJDK 17: Cannot refactor XXX.java that is defined outside of an open project.

2021-12-13 Thread Neil C Smith
On Mon, 13 Dec 2021, 20:02 Jim Mayer,  wrote:

> No, I don't, but I'm game to put a test case together if this requires
> investigation. I wasn't going to bother if it was a well know issue.
>

I have seen this occasionally. Try deleting the cache folder first. I would
also consider installing nb-javac. See if it occurs again.

Best wishes,

Neil


Re: NB 12.6, OpenJDK 17: Cannot refactor XXX.java that is defined outside of an open project.

2021-12-13 Thread Geertjan Wielenga
No one will be able to help without a project or reproducible steps.

Gj

On Mon, 13 Dec 2021 at 21:02, Jim Mayer  wrote:

> No, I don't, but I'm game to put a test case together if this requires
> investigation. I wasn't going to bother if it was a well know issue.
>
> Jim
>
> On Mon, Dec 13, 2021 at 11:59 AM Geertjan Wielenga <
> geertjan.wiele...@googlemail.com> wrote:
>
>> Do you have a project on GitHub or somewhere that reproduces this?
>>
>> Gj
>>
>> On Mon, 13 Dec 2021 at 20:57, Jim Mayer  wrote:
>>
>>> Hi all,
>>>
>>> I decided to try out the latest version of NetBeans, but am running into
>>> a serious problem. After even just a few minutes of work, it gets into a
>>> state where trying to rename a class creates a popup that says:
>>>
>>> Cannot refactor XXX.java that is defined outside of an open project.
>>>
>>> After this happens, I've also noticed that, when using the "Net Java
>>> Class" dialogue, that "superclass"  and "interfaces" browsing no longer
>>> finds classes defined in my project. This makes me suspicious that the
>>> index is being corrupted somehow, but that's just a guess.
>>>
>>> Here's my configuration version from the About page:
>>>
>>> Product Version: Apache NetBeans IDE 12.6
>>> Java: 17.0.1; OpenJDK 64-Bit Server VM 17.0.1+12-Ubuntu-120.04
>>> Runtime: OpenJDK Runtime Environment 17.0.1+12-Ubuntu-120.04
>>> System: Linux version 5.4.0-91-generic running on amd64; UTF-8; en_CA
>>> (nb)
>>>
>>> My OS is "Ubuntu 20.04.3 LTS".
>>>
>>> My project is a java library built with Gradle, and was created, fresh,
>>> using this version of NetBeans. In other words, I didn't import an existing
>>> project. I created a new project and copied in existing files that were, in
>>> fact, created with NetBeans 12.6.
>>>
>>> I have tried this both with, and without, the "nb-javac" plugin
>>> installed, since other notes on this thread suggest that the plugin should
>>> not be installed when using newer javac releases. I've tried installing
>>> NetBeans using Snap and the installer. Currently, I'm using the installer
>>> downloaded directly from the NetBeans site and "nb-javac" is not installed.
>>>
>>> I'm wondering if these are problems in the NetBeans 12.6 release, or if
>>> there's some incompatibility with my environment.
>>>
>>> (1) Does anyone else see this?
>>> (2) Should I be using a different JDK? I'm using the latest Java 17
>>> OpenJDK release that's in the Ubuntu 20.04.3 LTS release.
>>>
>>> Jim Mayer
>>>
>>


Re: NB 12.6, OpenJDK 17: Cannot refactor XXX.java that is defined outside of an open project.

2021-12-13 Thread Jim Mayer
No, I don't, but I'm game to put a test case together if this requires
investigation. I wasn't going to bother if it was a well know issue.

Jim

On Mon, Dec 13, 2021 at 11:59 AM Geertjan Wielenga <
geertjan.wiele...@googlemail.com> wrote:

> Do you have a project on GitHub or somewhere that reproduces this?
>
> Gj
>
> On Mon, 13 Dec 2021 at 20:57, Jim Mayer  wrote:
>
>> Hi all,
>>
>> I decided to try out the latest version of NetBeans, but am running into
>> a serious problem. After even just a few minutes of work, it gets into a
>> state where trying to rename a class creates a popup that says:
>>
>> Cannot refactor XXX.java that is defined outside of an open project.
>>
>> After this happens, I've also noticed that, when using the "Net Java
>> Class" dialogue, that "superclass"  and "interfaces" browsing no longer
>> finds classes defined in my project. This makes me suspicious that the
>> index is being corrupted somehow, but that's just a guess.
>>
>> Here's my configuration version from the About page:
>>
>> Product Version: Apache NetBeans IDE 12.6
>> Java: 17.0.1; OpenJDK 64-Bit Server VM 17.0.1+12-Ubuntu-120.04
>> Runtime: OpenJDK Runtime Environment 17.0.1+12-Ubuntu-120.04
>> System: Linux version 5.4.0-91-generic running on amd64; UTF-8; en_CA (nb)
>>
>> My OS is "Ubuntu 20.04.3 LTS".
>>
>> My project is a java library built with Gradle, and was created, fresh,
>> using this version of NetBeans. In other words, I didn't import an existing
>> project. I created a new project and copied in existing files that were, in
>> fact, created with NetBeans 12.6.
>>
>> I have tried this both with, and without, the "nb-javac" plugin
>> installed, since other notes on this thread suggest that the plugin should
>> not be installed when using newer javac releases. I've tried installing
>> NetBeans using Snap and the installer. Currently, I'm using the installer
>> downloaded directly from the NetBeans site and "nb-javac" is not installed.
>>
>> I'm wondering if these are problems in the NetBeans 12.6 release, or if
>> there's some incompatibility with my environment.
>>
>> (1) Does anyone else see this?
>> (2) Should I be using a different JDK? I'm using the latest Java 17
>> OpenJDK release that's in the Ubuntu 20.04.3 LTS release.
>>
>> Jim Mayer
>>
>


Re: NB 12.6, OpenJDK 17: Cannot refactor XXX.java that is defined outside of an open project.

2021-12-13 Thread Geertjan Wielenga
Do you have a project on GitHub or somewhere that reproduces this?

Gj

On Mon, 13 Dec 2021 at 20:57, Jim Mayer  wrote:

> Hi all,
>
> I decided to try out the latest version of NetBeans, but am running into a
> serious problem. After even just a few minutes of work, it gets into a
> state where trying to rename a class creates a popup that says:
>
> Cannot refactor XXX.java that is defined outside of an open project.
>
> After this happens, I've also noticed that, when using the "Net Java
> Class" dialogue, that "superclass"  and "interfaces" browsing no longer
> finds classes defined in my project. This makes me suspicious that the
> index is being corrupted somehow, but that's just a guess.
>
> Here's my configuration version from the About page:
>
> Product Version: Apache NetBeans IDE 12.6
> Java: 17.0.1; OpenJDK 64-Bit Server VM 17.0.1+12-Ubuntu-120.04
> Runtime: OpenJDK Runtime Environment 17.0.1+12-Ubuntu-120.04
> System: Linux version 5.4.0-91-generic running on amd64; UTF-8; en_CA (nb)
>
> My OS is "Ubuntu 20.04.3 LTS".
>
> My project is a java library built with Gradle, and was created, fresh,
> using this version of NetBeans. In other words, I didn't import an existing
> project. I created a new project and copied in existing files that were, in
> fact, created with NetBeans 12.6.
>
> I have tried this both with, and without, the "nb-javac" plugin installed,
> since other notes on this thread suggest that the plugin should not be
> installed when using newer javac releases. I've tried installing NetBeans
> using Snap and the installer. Currently, I'm using the installer downloaded
> directly from the NetBeans site and "nb-javac" is not installed.
>
> I'm wondering if these are problems in the NetBeans 12.6 release, or if
> there's some incompatibility with my environment.
>
> (1) Does anyone else see this?
> (2) Should I be using a different JDK? I'm using the latest Java 17
> OpenJDK release that's in the Ubuntu 20.04.3 LTS release.
>
> Jim Mayer
>


NB 12.6, OpenJDK 17: Cannot refactor XXX.java that is defined outside of an open project.

2021-12-13 Thread Jim Mayer
Hi all,

I decided to try out the latest version of NetBeans, but am running into a
serious problem. After even just a few minutes of work, it gets into a
state where trying to rename a class creates a popup that says:

Cannot refactor XXX.java that is defined outside of an open project.

After this happens, I've also noticed that, when using the "Net Java Class"
dialogue, that "superclass"  and "interfaces" browsing no longer finds
classes defined in my project. This makes me suspicious that the index is
being corrupted somehow, but that's just a guess.

Here's my configuration version from the About page:

Product Version: Apache NetBeans IDE 12.6
Java: 17.0.1; OpenJDK 64-Bit Server VM 17.0.1+12-Ubuntu-120.04
Runtime: OpenJDK Runtime Environment 17.0.1+12-Ubuntu-120.04
System: Linux version 5.4.0-91-generic running on amd64; UTF-8; en_CA (nb)

My OS is "Ubuntu 20.04.3 LTS".

My project is a java library built with Gradle, and was created, fresh,
using this version of NetBeans. In other words, I didn't import an existing
project. I created a new project and copied in existing files that were, in
fact, created with NetBeans 12.6.

I have tried this both with, and without, the "nb-javac" plugin installed,
since other notes on this thread suggest that the plugin should not be
installed when using newer javac releases. I've tried installing NetBeans
using Snap and the installer. Currently, I'm using the installer downloaded
directly from the NetBeans site and "nb-javac" is not installed.

I'm wondering if these are problems in the NetBeans 12.6 release, or if
there's some incompatibility with my environment.

(1) Does anyone else see this?
(2) Should I be using a different JDK? I'm using the latest Java 17 OpenJDK
release that's in the Ubuntu 20.04.3 LTS release.

Jim Mayer


Re: macOS, Monterey, M1 - can't show in Finder

2021-12-13 Thread Carl Mosca
Started from the command line:


Java 11:


WARNING: package sun.awt.X11 not in java.desktop

WARNING: package com.sun.java.swing.plaf.gtk not in java.desktop

WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by
org.netbeans.modules.applemenu.ShowInFinder$1
(jar:file:/Applications/NetBeans/Apache%20NetBeans%2012.6.app/Contents/Resources/NetBeans/netbeans/platform/modules/org-netbeans-modules-applemenu.jar!/)
to method com.apple.eio.FileManager.revealInFinder(java.io.File)

WARNING: Please consider reporting this to the maintainers of
org.netbeans.modules.applemenu.ShowInFinder$1

WARNING: Use --illegal-access=warn to enable warnings of further illegal
reflective access operations

WARNING: All illegal access operations will be denied in a future release


Java 17:



WARNING: package sun.awt.X11 not in java.desktop

WARNING: package com.sun.java.swing.plaf.gtk not in java.desktop

WARNING: A terminally deprecated method in java.lang.System has been called

WARNING: System::setSecurityManager has been called by
org.netbeans.TopSecurityManager
(file:/Applications/NetBeans/Apache%20NetBeans%2012.6.app/Contents/Resources/NetBeans/netbeans/platform/lib/boot.jar)

WARNING: Please consider reporting this to the maintainers of
org.netbeans.TopSecurityManager

WARNING: System::setSecurityManager will be removed in a future release

On Mon, Dec 13, 2021 at 7:26 AM Juan Miguel Escribano 
wrote:

> Same here,
>
> Netbeans 12.6 with Java 17, BUT MacBook Pro INTEL
>
> “Show in Finder” does not work.
>
> Juan Miguel
>
> El 13 dic 2021, a las 12:35, Carl Mosca  escribió:
>
> I was seeing this as well running Java 17.  I switched back to 11 and it
> seems to be working...but I have only had one cup of coffee.  Running macOS
> 12.0.1 on an M1 MacBook Air.
>
> On Mon, Dec 13, 2021 at 12:56 AM David Green  wrote:
>
>> Hi,
>>
>> On a new MacBook Pro with M1 processor and running Monterey.  Running
>> NetBeans 12.6 but just tried 12.4 and same issue.
>>
>> Highlighting a source code file (or a folder), and right-click select
>> Tools | Show in Finder, nothing happens.  It used to work on my old
>> Intel-based machine running BigSur and earlier (can’t speak to Monterey on
>> Intel).
>>
>> On the same menu, is Tools | Open in Terminal which works to open
>> terminal with the working directory of the containing folder.
>>
>> Is this a NetBeans/OS problem or something specific to my machine?
>> NetBeans 12.6 (nor earlier) shows up in the System Preferences | Security &
>> Privacy | Automation where some programs that control other programs are
>> listed.  I was not able to find any error messages.
>>
>> Clearly, the workaround is to use the Open in Terminal and then type
>> “open .” in the terminal window.
>>
>> Thanks for any ideas,
>>
>> Dave
>>
>
>
> --
> Carl J. Mosca
>
>
>

-- 
Carl J. Mosca


Re: macOS, Monterey, M1 - can't show in Finder

2021-12-13 Thread Juan Miguel Escribano
Same here,

Netbeans 12.6 with Java 17, BUT MacBook Pro INTEL

“Show in Finder” does not work.

Juan Miguel

> El 13 dic 2021, a las 12:35, Carl Mosca  escribió:
> 
> I was seeing this as well running Java 17.  I switched back to 11 and it 
> seems to be working...but I have only had one cup of coffee.  Running macOS 
> 12.0.1 on an M1 MacBook Air.
> 
> On Mon, Dec 13, 2021 at 12:56 AM David Green  > wrote:
> Hi,
> 
> On a new MacBook Pro with M1 processor and running Monterey.  Running 
> NetBeans 12.6 but just tried 12.4 and same issue.
> 
> Highlighting a source code file (or a folder), and right-click select Tools | 
> Show in Finder, nothing happens.  It used to work on my old Intel-based 
> machine running BigSur and earlier (can’t speak to Monterey on Intel).
> 
> On the same menu, is Tools | Open in Terminal which works to open terminal 
> with the working directory of the containing folder.
> 
> Is this a NetBeans/OS problem or something specific to my machine?  NetBeans 
> 12.6 (nor earlier) shows up in the System Preferences | Security & Privacy | 
> Automation where some programs that control other programs are listed.  I was 
> not able to find any error messages.
> 
> Clearly, the workaround is to use the Open in Terminal and then type “open .” 
> in the terminal window.
> 
> Thanks for any ideas,
> 
> Dave
> 
> 
> -- 
> Carl J. Mosca



Re: macOS, Monterey, M1 - can't show in Finder

2021-12-13 Thread Carl Mosca
I was seeing this as well running Java 17.  I switched back to 11 and it
seems to be working...but I have only had one cup of coffee.  Running macOS
12.0.1 on an M1 MacBook Air.

On Mon, Dec 13, 2021 at 12:56 AM David Green  wrote:

> Hi,
>
> On a new MacBook Pro with M1 processor and running Monterey.  Running
> NetBeans 12.6 but just tried 12.4 and same issue.
>
> Highlighting a source code file (or a folder), and right-click select
> Tools | Show in Finder, nothing happens.  It used to work on my old
> Intel-based machine running BigSur and earlier (can’t speak to Monterey on
> Intel).
>
> On the same menu, is Tools | Open in Terminal which works to open terminal
> with the working directory of the containing folder.
>
> Is this a NetBeans/OS problem or something specific to my machine?
> NetBeans 12.6 (nor earlier) shows up in the System Preferences | Security &
> Privacy | Automation where some programs that control other programs are
> listed.  I was not able to find any error messages.
>
> Clearly, the workaround is to use the Open in Terminal and then type “open
> .” in the terminal window.
>
> Thanks for any ideas,
>
> Dave
>


-- 
Carl J. Mosca