You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Paulo Toledo <pa...@yahoo.com.br.INVALID> on 2021/06/04 15:47:24 UTC

Fix imports (Ctrl+Shift+I)

Hi

Are there any problems importing when using the shortcut (Ctrl+Shift+I) 
to fix the imports?

I use Netbeans 12.4 with Java

     openjdk version "11.0.11" 2021-04-20

     OpenJDK Runtime Environment 18.9 (build 11.0.11+9)

     OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9, mixed mode, sharing)

Below is an image attached demonstrating the problem.

Thanks in advance if anyone can give me a tip.


Re: Fix imports (Ctrl+Shift+I)

Posted by Paulo Toledo <pa...@yahoo.com.br.INVALID>.
Hi Thomas,
Killed the riddle!
I tested it here and that's really what happens.
Thank you very much for the feedback.
Regards
Paulo Toledo


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Fix imports (Ctrl+Shift+I)

Posted by Thomas Kellerer <sh...@gmx.net>.
This seems to only happen with Ant projects. Maven projects don't seem to have this problem.

If you expand the "JDK 11" node below the "Java dependencies" in the Ant project it shows the modules with the little blue icon but fails to include java.sql

This is how the expanded JDK 11 node (in the "Libraries" section) looks in an Ant project:


The project was created with "New Project -> Java with Ant -> Java Application" (*NOT* as a "Java modular project").

And this is how it looks like in a Maven project with a comparable setup

It seems the Ant project is treated as a "module project" even though it is not.

While the Maven project is treated as a "non-module" project and thus includes the full JDK.

I didn't find any project properties for the Ant project that would change this behaviour. Is this a sign that Ant projects are becoming 2nd class citizens now?

I tested this with 12.3 and 12.4

Regards
Thomas

Ty Young schrieb am 05.06.2021 um 23:49:
>
> If the project uses modules then you need to require the java.sql module. Otherwise it may be because of nb-javac. Try installing or uninstalling it.
>
>
> On 6/4/21 10:47 AM, Paulo Toledo wrote:
>>
>> Hi
>>
>> Are there any problems importing when using the shortcut (Ctrl+Shift+I) to fix the imports?
>>
>> I use Netbeans 12.4 with Java
>>
>>     openjdk version "11.0.11" 2021-04-20
>>
>>     OpenJDK Runtime Environment 18.9 (build 11.0.11+9)
>>
>>     OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9, mixed mode, sharing)
>>
>> Below is an image attached demonstrating the problem.
>>
>> Thanks in advance if anyone can give me a tip.
>>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
For additional commands, e-mail: users-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Re: Fix imports (Ctrl+Shift+I)

Posted by Ty Young <yo...@gmail.com>.
If the project uses modules then you need to require the java.sql 
module. Otherwise it may be because of nb-javac. Try installing or 
uninstalling it.


On 6/4/21 10:47 AM, Paulo Toledo wrote:
>
> Hi
>
> Are there any problems importing when using the shortcut 
> (Ctrl+Shift+I) to fix the imports?
>
> I use Netbeans 12.4 with Java
>
>     openjdk version "11.0.11" 2021-04-20
>
>     OpenJDK Runtime Environment 18.9 (build 11.0.11+9)
>
>     OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9, mixed mode, sharing)
>
> Below is an image attached demonstrating the problem.
>
> Thanks in advance if anyone can give me a tip.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@netbeans.apache.org
> For additional commands, e-mail: users-help@netbeans.apache.org
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Re: Fix imports (Ctrl+Shift+I)

Posted by Paulo Toledo <pa...@yahoo.com.br.INVALID>.
I found that by changing the project properties in Netbeans, the 
Source/Binary Format: option from JDK11 to JDK8 the shortcut 
(Crtl+Shift+I) works normally for java.sql imports.
If I return to the JDK11 option it doesn't correctly import the java.sql.