You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by Humphrey Clerx <hc...@gmail.com> on 2019/11/22 09:36:16 UTC

NetBeans 11.2 "cannot find symbol" error

I've recently installed NetBeans 11.2 and found a problem that a lot of
files are marked with an "error" symbol that a certain class cannot be
found, annotated by an "cannot find symbol" icon on an import statement
even though the class to be imported exists.

Clearing the cache and restarting NetBeans does not solve the problem.

This problem did not occur on NetBeans 8.2 or NetBeans 11.0/11.1.

It seems to be related to there being two classes (in different modules)
with the same class name. NetBeans 11.2 only seems to 'index' the first of
the two and indicates the error on al imports of the second one.

When building the project however, there is no problem. Only the incorrect
error annotations on the files. I am using NetBeans 11.2 together with the
nb-javac plugin.

Is there any means of clearing this invalid error?

-- 
In the mountains of truth, you never climb in vain - Nietzsche
#-------------------------------------------------------------
 \_O
,__/>
  <"
   '

Re: NetBeans 11.2 "cannot find symbol" error

Posted by Geertjan Wielenga <ge...@apache.org>.
What happens if you uninstall the nb-javac plugin and then restart NetBeans?

Gj

On Fri, Nov 22, 2019 at 10:36 AM Humphrey Clerx <hc...@gmail.com> wrote:

> I've recently installed NetBeans 11.2 and found a problem that a lot of
> files are marked with an "error" symbol that a certain class cannot be
> found, annotated by an "cannot find symbol" icon on an import statement
> even though the class to be imported exists.
>
> Clearing the cache and restarting NetBeans does not solve the problem.
>
> This problem did not occur on NetBeans 8.2 or NetBeans 11.0/11.1.
>
> It seems to be related to there being two classes (in different modules)
> with the same class name. NetBeans 11.2 only seems to 'index' the first of
> the two and indicates the error on al imports of the second one.
>
> When building the project however, there is no problem. Only the incorrect
> error annotations on the files. I am using NetBeans 11.2 together with the
> nb-javac plugin.
>
> Is there any means of clearing this invalid error?
>
> --
> In the mountains of truth, you never climb in vain - Nietzsche
> #-------------------------------------------------------------
>  \_O
> ,__/>
>   <"
>    '
>

Re: NetBeans 11.2 "cannot find symbol" error

Posted by Geertjan Wielenga <ge...@apache.org>.
nb-javac has a problem which is currently being fixed. If you're using
NetBeans running on top of a JDK after JDK 8, when you don't have nb-javac
installed, you can get a lot/most of the functionality you would have had
from nb-javac directly from the javac that is part of the JDK. What your
RCP application runs on, whether JDK 8 or whatever else, shouldn't have an
impact on what the NetBeans you're using to develop it runs on.

No, the nb-javac plugin does not require JDK 11 or later. Instead, as
pointed out above, with JDK 9 or later you can choose to not use nb-javac
and ultimately we'd want to not depend on nb-javac at all.

Also read this: https://blogs.apache.org/netbeans/entry/what-s-nb-javac-in

And what is the RCP application you're referring to? Could you share some
screenshots, it's always good to know about the applications created on top
of NetBeans, please add it here if not already there:

https://cwiki.apache.org/confluence/display/NETBEANS/on+top+of+NetBeans

Also, please stop sending mails to me directly and use the mailing list
instead, sending this there now.

Thanks,

Gj


On Tue, Nov 26, 2019 at 4:25 PM Humphrey Clerx <hc...@gmail.com> wrote:

> Hi Hj,
>
> I will try, but out RCP application still requires JDK 8 due to
> dependencies. That makes it difficult to switch to JDK 11 in NetBeans.
>
> Does this mean nb-javac for NetBeans 11.2 and onwards no longer supports a
> NetBeans running with a JDK 8? I did try installing nb-javac 1.72 under
> NetBeans 11.2,but it gives the same problem.
>
> How come that NetBeans itself can still run with JDK 8, but the nb-javac
> plugin requires JDK 11 or later?
>
> Will this problem be addressed in NetBeans 11.3, or do I have to live with
> it?
>
> Greets,
>      Humphrey.
>
>
> On Tue, Nov 26, 2019 at 1:36 PM Geertjan Wielenga <ge...@apache.org>
> wrote:
>
>> Can you use a later JDK, e.g., JDK 13, which will mean you'll be using
>> its javac, when nb-javac is not installed (this is not possible with JDK 8
>> or earlier).
>>
>> Gj
>>
>> On Tue, Nov 26, 2019 at 11:48 AM Humphrey Clerx <hc...@gmail.com> wrote:
>>
>>> JDK 8
>>>
>>> On Tue, Nov 26, 2019 at 9:21 AM Geertjan Wielenga <ge...@apache.org>
>>> wrote:
>>>
>>>> Which JDK are you using?
>>>>
>>>> Gj
>>>>
>>>> On Tue, Nov 26, 2019 at 9:11 AM Humphrey Clerx <hc...@gmail.com>
>>>> wrote:
>>>>
>>>>> Uninstalling nb-javac does remove the error badges, but it also
>>>>> removes any functionality to use Ctrl-click on a class to open the file,
>>>>> and it doesn't indicate any error(s) in the file when edititng.
>>>>>
>>>>> On Mon, Nov 25, 2019 at 2:45 PM Geertjan Wielenga <ge...@apache.org>
>>>>> wrote:
>>>>>
>>>>>> Uninstall nb-javac. Then, do not reinstall it. Do not use nb-javac to
>>>>>> see if that solves the problem.
>>>>>>
>>>>>> Gj
>>>>>>
>>>>>> On Mon, Nov 25, 2019 at 2:13 PM Humphrey Clerx <hc...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Gj,
>>>>>>>
>>>>>>> I tried de-activating nb-javac and then re-starting NetBeans (with
>>>>>>> and without clearing the Cache folder) and re-activating nb-javac. This
>>>>>>> doesn't solve the problem.
>>>>>>>
>>>>>>> I also tried de-installing nb-javac and then re-starting NetBeans
>>>>>>> (with and without clearing the Cache folder) and re-installing nb-javac.
>>>>>>> This also doesn't solve the problem.
>>>>>>>
>>>>>>> How and where can I check how/why the indexing seems to go wrong?
>>>>>>> When I do a Ctrl-O and type the name of the duplicate class, both appear in
>>>>>>> the list.
>>>>>>>
>>>>>>> Greets,
>>>>>>>     H.
>>>>>>>
>>>>>>> On Sun, Nov 24, 2019 at 9:15 AM Geertjan Wielenga <
>>>>>>> geertjan@apache.org> wrote:
>>>>>>>
>>>>>>>> What happens if you uninstall the nb-javac plugin.
>>>>>>>>
>>>>>>>> Gj
>>>>>>>>
>>>>>>>>
>>>>>>>> On Sun, 24 Nov 2019 at 09:07, Humphrey Clerx <hc...@gmail.com>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Slightly modifying a file with an error badge doesn't solve the
>>>>>>>>> problem. And it doesn't involve any enum classes. Somehow NetBeans
>>>>>>>>> "forgets" the first class when it parses/indexes/caches the second one with
>>>>>>>>> the same name (in a different module).
>>>>>>>>>
>>>>>>>>> On Sat, Nov 23, 2019 at 1:19 AM Eirik Bakke <eb...@ultorg.com>
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Is this a Maven or an Ant project?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> If you open up the source for _each_ of the classes involved,
>>>>>>>>>> including classes imported by the class with an error icon on it, insert a
>>>>>>>>>> space somewhere, and save it (to trigger Compile-on-Save), does the error
>>>>>>>>>> go away?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Are there, by any chance, any "enum" classes involved? What about
>>>>>>>>>> annotations? (E.g. "@Nullable".)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> (I've had quite a few of these errors myself, but possibly in
>>>>>>>>>> different situations.)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -- Eirik
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> *From:* Humphrey Clerx <hc...@gmail.com>
>>>>>>>>>> *Sent:* Friday, November 22, 2019 4:36 AM
>>>>>>>>>> *To:* users@netbeans.apache.org
>>>>>>>>>> *Subject:* NetBeans 11.2 "cannot find symbol" error
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> I've recently installed NetBeans 11.2 and found a problem that a
>>>>>>>>>> lot of files are marked with an "error" symbol that a certain class cannot
>>>>>>>>>> be found, annotated by an "cannot find symbol" icon on an import statement
>>>>>>>>>> even though the class to be imported exists.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Clearing the cache and restarting NetBeans does not solve the
>>>>>>>>>> problem.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> This problem did not occur on NetBeans 8.2 or NetBeans 11.0/11.1.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> It seems to be related to there being two classes (in different
>>>>>>>>>> modules) with the same class name. NetBeans 11.2 only seems to 'index' the
>>>>>>>>>> first of the two and indicates the error on al imports of the second one.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> When building the project however, there is no problem. Only the
>>>>>>>>>> incorrect error annotations on the files. I am using NetBeans 11.2 together
>>>>>>>>>> with the nb-javac plugin.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Is there any means of clearing this invalid error?
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>>
>>>>>>>>>> In the mountains of truth, you never climb in vain - Nietzsche
>>>>>>>>>> #-------------------------------------------------------------
>>>>>>>>>>  \_O
>>>>>>>>>> ,__/>
>>>>>>>>>>   <"
>>>>>>>>>>    '
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> In the mountains of truth, you never climb in vain - Nietzsche
>>>>>>>>> #-------------------------------------------------------------
>>>>>>>>>  \_O
>>>>>>>>> ,__/>
>>>>>>>>>   <"
>>>>>>>>>    '
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> In the mountains of truth, you never climb in vain - Nietzsche
>>>>>>> #-------------------------------------------------------------
>>>>>>>  \_O
>>>>>>> ,__/>
>>>>>>>   <"
>>>>>>>    '
>>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> In the mountains of truth, you never climb in vain - Nietzsche
>>>>> #-------------------------------------------------------------
>>>>>  \_O
>>>>> ,__/>
>>>>>   <"
>>>>>    '
>>>>>
>>>>
>>>
>>> --
>>> In the mountains of truth, you never climb in vain - Nietzsche
>>> #-------------------------------------------------------------
>>>  \_O
>>> ,__/>
>>>   <"
>>>    '
>>>
>>
>
> --
> In the mountains of truth, you never climb in vain - Nietzsche
> #-------------------------------------------------------------
>  \_O
> ,__/>
>   <"
>    '
>

Re: NetBeans 11.2 "cannot find symbol" error

Posted by Geertjan Wielenga <ge...@apache.org>.
Which JDK are you using?

Gj

On Tue, Nov 26, 2019 at 9:11 AM Humphrey Clerx <hc...@gmail.com> wrote:

> Uninstalling nb-javac does remove the error badges, but it also removes
> any functionality to use Ctrl-click on a class to open the file, and it
> doesn't indicate any error(s) in the file when edititng.
>
> On Mon, Nov 25, 2019 at 2:45 PM Geertjan Wielenga <ge...@apache.org>
> wrote:
>
>> Uninstall nb-javac. Then, do not reinstall it. Do not use nb-javac to see
>> if that solves the problem.
>>
>> Gj
>>
>> On Mon, Nov 25, 2019 at 2:13 PM Humphrey Clerx <hc...@gmail.com> wrote:
>>
>>> Hi Gj,
>>>
>>> I tried de-activating nb-javac and then re-starting NetBeans (with and
>>> without clearing the Cache folder) and re-activating nb-javac. This doesn't
>>> solve the problem.
>>>
>>> I also tried de-installing nb-javac and then re-starting NetBeans (with
>>> and without clearing the Cache folder) and re-installing nb-javac. This
>>> also doesn't solve the problem.
>>>
>>> How and where can I check how/why the indexing seems to go wrong? When I
>>> do a Ctrl-O and type the name of the duplicate class, both appear in the
>>> list.
>>>
>>> Greets,
>>>     H.
>>>
>>> On Sun, Nov 24, 2019 at 9:15 AM Geertjan Wielenga <ge...@apache.org>
>>> wrote:
>>>
>>>> What happens if you uninstall the nb-javac plugin.
>>>>
>>>> Gj
>>>>
>>>>
>>>> On Sun, 24 Nov 2019 at 09:07, Humphrey Clerx <hc...@gmail.com> wrote:
>>>>
>>>>> Slightly modifying a file with an error badge doesn't solve the
>>>>> problem. And it doesn't involve any enum classes. Somehow NetBeans
>>>>> "forgets" the first class when it parses/indexes/caches the second one with
>>>>> the same name (in a different module).
>>>>>
>>>>> On Sat, Nov 23, 2019 at 1:19 AM Eirik Bakke <eb...@ultorg.com> wrote:
>>>>>
>>>>>> Is this a Maven or an Ant project?
>>>>>>
>>>>>>
>>>>>>
>>>>>> If you open up the source for _each_ of the classes involved,
>>>>>> including classes imported by the class with an error icon on it, insert a
>>>>>> space somewhere, and save it (to trigger Compile-on-Save), does the error
>>>>>> go away?
>>>>>>
>>>>>>
>>>>>>
>>>>>> Are there, by any chance, any "enum" classes involved? What about
>>>>>> annotations? (E.g. "@Nullable".)
>>>>>>
>>>>>>
>>>>>>
>>>>>> (I've had quite a few of these errors myself, but possibly in
>>>>>> different situations.)
>>>>>>
>>>>>>
>>>>>>
>>>>>> -- Eirik
>>>>>>
>>>>>>
>>>>>>
>>>>>> *From:* Humphrey Clerx <hc...@gmail.com>
>>>>>> *Sent:* Friday, November 22, 2019 4:36 AM
>>>>>> *To:* users@netbeans.apache.org
>>>>>> *Subject:* NetBeans 11.2 "cannot find symbol" error
>>>>>>
>>>>>>
>>>>>>
>>>>>> I've recently installed NetBeans 11.2 and found a problem that a lot
>>>>>> of files are marked with an "error" symbol that a certain class cannot be
>>>>>> found, annotated by an "cannot find symbol" icon on an import statement
>>>>>> even though the class to be imported exists.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Clearing the cache and restarting NetBeans does not solve the problem.
>>>>>>
>>>>>>
>>>>>>
>>>>>> This problem did not occur on NetBeans 8.2 or NetBeans 11.0/11.1.
>>>>>>
>>>>>>
>>>>>>
>>>>>> It seems to be related to there being two classes (in different
>>>>>> modules) with the same class name. NetBeans 11.2 only seems to 'index' the
>>>>>> first of the two and indicates the error on al imports of the second one.
>>>>>>
>>>>>>
>>>>>>
>>>>>> When building the project however, there is no problem. Only the
>>>>>> incorrect error annotations on the files. I am using NetBeans 11.2 together
>>>>>> with the nb-javac plugin.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Is there any means of clearing this invalid error?
>>>>>>
>>>>>> --
>>>>>>
>>>>>> In the mountains of truth, you never climb in vain - Nietzsche
>>>>>> #-------------------------------------------------------------
>>>>>>  \_O
>>>>>> ,__/>
>>>>>>   <"
>>>>>>    '
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> In the mountains of truth, you never climb in vain - Nietzsche
>>>>> #-------------------------------------------------------------
>>>>>  \_O
>>>>> ,__/>
>>>>>   <"
>>>>>    '
>>>>>
>>>>
>>>
>>> --
>>> In the mountains of truth, you never climb in vain - Nietzsche
>>> #-------------------------------------------------------------
>>>  \_O
>>> ,__/>
>>>   <"
>>>    '
>>>
>>
>
> --
> In the mountains of truth, you never climb in vain - Nietzsche
> #-------------------------------------------------------------
>  \_O
> ,__/>
>   <"
>    '
>

Re: NetBeans 11.2 "cannot find symbol" error

Posted by Humphrey Clerx <hc...@gmail.com>.
Uninstalling nb-javac does remove the error badges, but it also removes any
functionality to use Ctrl-click on a class to open the file, and it doesn't
indicate any error(s) in the file when edititng.

On Mon, Nov 25, 2019 at 2:45 PM Geertjan Wielenga <ge...@apache.org>
wrote:

> Uninstall nb-javac. Then, do not reinstall it. Do not use nb-javac to see
> if that solves the problem.
>
> Gj
>
> On Mon, Nov 25, 2019 at 2:13 PM Humphrey Clerx <hc...@gmail.com> wrote:
>
>> Hi Gj,
>>
>> I tried de-activating nb-javac and then re-starting NetBeans (with and
>> without clearing the Cache folder) and re-activating nb-javac. This doesn't
>> solve the problem.
>>
>> I also tried de-installing nb-javac and then re-starting NetBeans (with
>> and without clearing the Cache folder) and re-installing nb-javac. This
>> also doesn't solve the problem.
>>
>> How and where can I check how/why the indexing seems to go wrong? When I
>> do a Ctrl-O and type the name of the duplicate class, both appear in the
>> list.
>>
>> Greets,
>>     H.
>>
>> On Sun, Nov 24, 2019 at 9:15 AM Geertjan Wielenga <ge...@apache.org>
>> wrote:
>>
>>> What happens if you uninstall the nb-javac plugin.
>>>
>>> Gj
>>>
>>>
>>> On Sun, 24 Nov 2019 at 09:07, Humphrey Clerx <hc...@gmail.com> wrote:
>>>
>>>> Slightly modifying a file with an error badge doesn't solve the
>>>> problem. And it doesn't involve any enum classes. Somehow NetBeans
>>>> "forgets" the first class when it parses/indexes/caches the second one with
>>>> the same name (in a different module).
>>>>
>>>> On Sat, Nov 23, 2019 at 1:19 AM Eirik Bakke <eb...@ultorg.com> wrote:
>>>>
>>>>> Is this a Maven or an Ant project?
>>>>>
>>>>>
>>>>>
>>>>> If you open up the source for _each_ of the classes involved,
>>>>> including classes imported by the class with an error icon on it, insert a
>>>>> space somewhere, and save it (to trigger Compile-on-Save), does the error
>>>>> go away?
>>>>>
>>>>>
>>>>>
>>>>> Are there, by any chance, any "enum" classes involved? What about
>>>>> annotations? (E.g. "@Nullable".)
>>>>>
>>>>>
>>>>>
>>>>> (I've had quite a few of these errors myself, but possibly in
>>>>> different situations.)
>>>>>
>>>>>
>>>>>
>>>>> -- Eirik
>>>>>
>>>>>
>>>>>
>>>>> *From:* Humphrey Clerx <hc...@gmail.com>
>>>>> *Sent:* Friday, November 22, 2019 4:36 AM
>>>>> *To:* users@netbeans.apache.org
>>>>> *Subject:* NetBeans 11.2 "cannot find symbol" error
>>>>>
>>>>>
>>>>>
>>>>> I've recently installed NetBeans 11.2 and found a problem that a lot
>>>>> of files are marked with an "error" symbol that a certain class cannot be
>>>>> found, annotated by an "cannot find symbol" icon on an import statement
>>>>> even though the class to be imported exists.
>>>>>
>>>>>
>>>>>
>>>>> Clearing the cache and restarting NetBeans does not solve the problem.
>>>>>
>>>>>
>>>>>
>>>>> This problem did not occur on NetBeans 8.2 or NetBeans 11.0/11.1.
>>>>>
>>>>>
>>>>>
>>>>> It seems to be related to there being two classes (in different
>>>>> modules) with the same class name. NetBeans 11.2 only seems to 'index' the
>>>>> first of the two and indicates the error on al imports of the second one.
>>>>>
>>>>>
>>>>>
>>>>> When building the project however, there is no problem. Only the
>>>>> incorrect error annotations on the files. I am using NetBeans 11.2 together
>>>>> with the nb-javac plugin.
>>>>>
>>>>>
>>>>>
>>>>> Is there any means of clearing this invalid error?
>>>>>
>>>>> --
>>>>>
>>>>> In the mountains of truth, you never climb in vain - Nietzsche
>>>>> #-------------------------------------------------------------
>>>>>  \_O
>>>>> ,__/>
>>>>>   <"
>>>>>    '
>>>>>
>>>>
>>>>
>>>> --
>>>> In the mountains of truth, you never climb in vain - Nietzsche
>>>> #-------------------------------------------------------------
>>>>  \_O
>>>> ,__/>
>>>>   <"
>>>>    '
>>>>
>>>
>>
>> --
>> In the mountains of truth, you never climb in vain - Nietzsche
>> #-------------------------------------------------------------
>>  \_O
>> ,__/>
>>   <"
>>    '
>>
>

-- 
In the mountains of truth, you never climb in vain - Nietzsche
#-------------------------------------------------------------
 \_O
,__/>
  <"
   '

Re: NetBeans 11.2 "cannot find symbol" error

Posted by Geertjan Wielenga <ge...@apache.org>.
Uninstall nb-javac. Then, do not reinstall it. Do not use nb-javac to see
if that solves the problem.

Gj

On Mon, Nov 25, 2019 at 2:13 PM Humphrey Clerx <hc...@gmail.com> wrote:

> Hi Gj,
>
> I tried de-activating nb-javac and then re-starting NetBeans (with and
> without clearing the Cache folder) and re-activating nb-javac. This doesn't
> solve the problem.
>
> I also tried de-installing nb-javac and then re-starting NetBeans (with
> and without clearing the Cache folder) and re-installing nb-javac. This
> also doesn't solve the problem.
>
> How and where can I check how/why the indexing seems to go wrong? When I
> do a Ctrl-O and type the name of the duplicate class, both appear in the
> list.
>
> Greets,
>     H.
>
> On Sun, Nov 24, 2019 at 9:15 AM Geertjan Wielenga <ge...@apache.org>
> wrote:
>
>> What happens if you uninstall the nb-javac plugin.
>>
>> Gj
>>
>>
>> On Sun, 24 Nov 2019 at 09:07, Humphrey Clerx <hc...@gmail.com> wrote:
>>
>>> Slightly modifying a file with an error badge doesn't solve the problem.
>>> And it doesn't involve any enum classes. Somehow NetBeans "forgets" the
>>> first class when it parses/indexes/caches the second one with the same name
>>> (in a different module).
>>>
>>> On Sat, Nov 23, 2019 at 1:19 AM Eirik Bakke <eb...@ultorg.com> wrote:
>>>
>>>> Is this a Maven or an Ant project?
>>>>
>>>>
>>>>
>>>> If you open up the source for _each_ of the classes involved, including
>>>> classes imported by the class with an error icon on it, insert a space
>>>> somewhere, and save it (to trigger Compile-on-Save), does the error go away?
>>>>
>>>>
>>>>
>>>> Are there, by any chance, any "enum" classes involved? What about
>>>> annotations? (E.g. "@Nullable".)
>>>>
>>>>
>>>>
>>>> (I've had quite a few of these errors myself, but possibly in different
>>>> situations.)
>>>>
>>>>
>>>>
>>>> -- Eirik
>>>>
>>>>
>>>>
>>>> *From:* Humphrey Clerx <hc...@gmail.com>
>>>> *Sent:* Friday, November 22, 2019 4:36 AM
>>>> *To:* users@netbeans.apache.org
>>>> *Subject:* NetBeans 11.2 "cannot find symbol" error
>>>>
>>>>
>>>>
>>>> I've recently installed NetBeans 11.2 and found a problem that a lot of
>>>> files are marked with an "error" symbol that a certain class cannot be
>>>> found, annotated by an "cannot find symbol" icon on an import statement
>>>> even though the class to be imported exists.
>>>>
>>>>
>>>>
>>>> Clearing the cache and restarting NetBeans does not solve the problem.
>>>>
>>>>
>>>>
>>>> This problem did not occur on NetBeans 8.2 or NetBeans 11.0/11.1.
>>>>
>>>>
>>>>
>>>> It seems to be related to there being two classes (in different
>>>> modules) with the same class name. NetBeans 11.2 only seems to 'index' the
>>>> first of the two and indicates the error on al imports of the second one.
>>>>
>>>>
>>>>
>>>> When building the project however, there is no problem. Only the
>>>> incorrect error annotations on the files. I am using NetBeans 11.2 together
>>>> with the nb-javac plugin.
>>>>
>>>>
>>>>
>>>> Is there any means of clearing this invalid error?
>>>>
>>>> --
>>>>
>>>> In the mountains of truth, you never climb in vain - Nietzsche
>>>> #-------------------------------------------------------------
>>>>  \_O
>>>> ,__/>
>>>>   <"
>>>>    '
>>>>
>>>
>>>
>>> --
>>> In the mountains of truth, you never climb in vain - Nietzsche
>>> #-------------------------------------------------------------
>>>  \_O
>>> ,__/>
>>>   <"
>>>    '
>>>
>>
>
> --
> In the mountains of truth, you never climb in vain - Nietzsche
> #-------------------------------------------------------------
>  \_O
> ,__/>
>   <"
>    '
>

Re: NetBeans 11.2 "cannot find symbol" error

Posted by Humphrey Clerx <hc...@gmail.com>.
Hi Gj,

I tried de-activating nb-javac and then re-starting NetBeans (with and
without clearing the Cache folder) and re-activating nb-javac. This doesn't
solve the problem.

I also tried de-installing nb-javac and then re-starting NetBeans (with and
without clearing the Cache folder) and re-installing nb-javac. This also
doesn't solve the problem.

How and where can I check how/why the indexing seems to go wrong? When I do
a Ctrl-O and type the name of the duplicate class, both appear in the list.

Greets,
    H.

On Sun, Nov 24, 2019 at 9:15 AM Geertjan Wielenga <ge...@apache.org>
wrote:

> What happens if you uninstall the nb-javac plugin.
>
> Gj
>
>
> On Sun, 24 Nov 2019 at 09:07, Humphrey Clerx <hc...@gmail.com> wrote:
>
>> Slightly modifying a file with an error badge doesn't solve the problem.
>> And it doesn't involve any enum classes. Somehow NetBeans "forgets" the
>> first class when it parses/indexes/caches the second one with the same name
>> (in a different module).
>>
>> On Sat, Nov 23, 2019 at 1:19 AM Eirik Bakke <eb...@ultorg.com> wrote:
>>
>>> Is this a Maven or an Ant project?
>>>
>>>
>>>
>>> If you open up the source for _each_ of the classes involved, including
>>> classes imported by the class with an error icon on it, insert a space
>>> somewhere, and save it (to trigger Compile-on-Save), does the error go away?
>>>
>>>
>>>
>>> Are there, by any chance, any "enum" classes involved? What about
>>> annotations? (E.g. "@Nullable".)
>>>
>>>
>>>
>>> (I've had quite a few of these errors myself, but possibly in different
>>> situations.)
>>>
>>>
>>>
>>> -- Eirik
>>>
>>>
>>>
>>> *From:* Humphrey Clerx <hc...@gmail.com>
>>> *Sent:* Friday, November 22, 2019 4:36 AM
>>> *To:* users@netbeans.apache.org
>>> *Subject:* NetBeans 11.2 "cannot find symbol" error
>>>
>>>
>>>
>>> I've recently installed NetBeans 11.2 and found a problem that a lot of
>>> files are marked with an "error" symbol that a certain class cannot be
>>> found, annotated by an "cannot find symbol" icon on an import statement
>>> even though the class to be imported exists.
>>>
>>>
>>>
>>> Clearing the cache and restarting NetBeans does not solve the problem.
>>>
>>>
>>>
>>> This problem did not occur on NetBeans 8.2 or NetBeans 11.0/11.1.
>>>
>>>
>>>
>>> It seems to be related to there being two classes (in different modules)
>>> with the same class name. NetBeans 11.2 only seems to 'index' the first of
>>> the two and indicates the error on al imports of the second one.
>>>
>>>
>>>
>>> When building the project however, there is no problem. Only the
>>> incorrect error annotations on the files. I am using NetBeans 11.2 together
>>> with the nb-javac plugin.
>>>
>>>
>>>
>>> Is there any means of clearing this invalid error?
>>>
>>> --
>>>
>>> In the mountains of truth, you never climb in vain - Nietzsche
>>> #-------------------------------------------------------------
>>>  \_O
>>> ,__/>
>>>   <"
>>>    '
>>>
>>
>>
>> --
>> In the mountains of truth, you never climb in vain - Nietzsche
>> #-------------------------------------------------------------
>>  \_O
>> ,__/>
>>   <"
>>    '
>>
>

-- 
In the mountains of truth, you never climb in vain - Nietzsche
#-------------------------------------------------------------
 \_O
,__/>
  <"
   '

Re: NetBeans 11.2 "cannot find symbol" error

Posted by Geertjan Wielenga <ge...@apache.org>.
What happens if you uninstall the nb-javac plugin.

Gj


On Sun, 24 Nov 2019 at 09:07, Humphrey Clerx <hc...@gmail.com> wrote:

> Slightly modifying a file with an error badge doesn't solve the problem.
> And it doesn't involve any enum classes. Somehow NetBeans "forgets" the
> first class when it parses/indexes/caches the second one with the same name
> (in a different module).
>
> On Sat, Nov 23, 2019 at 1:19 AM Eirik Bakke <eb...@ultorg.com> wrote:
>
>> Is this a Maven or an Ant project?
>>
>>
>>
>> If you open up the source for _each_ of the classes involved, including
>> classes imported by the class with an error icon on it, insert a space
>> somewhere, and save it (to trigger Compile-on-Save), does the error go away?
>>
>>
>>
>> Are there, by any chance, any "enum" classes involved? What about
>> annotations? (E.g. "@Nullable".)
>>
>>
>>
>> (I've had quite a few of these errors myself, but possibly in different
>> situations.)
>>
>>
>>
>> -- Eirik
>>
>>
>>
>> *From:* Humphrey Clerx <hc...@gmail.com>
>> *Sent:* Friday, November 22, 2019 4:36 AM
>> *To:* users@netbeans.apache.org
>> *Subject:* NetBeans 11.2 "cannot find symbol" error
>>
>>
>>
>> I've recently installed NetBeans 11.2 and found a problem that a lot of
>> files are marked with an "error" symbol that a certain class cannot be
>> found, annotated by an "cannot find symbol" icon on an import statement
>> even though the class to be imported exists.
>>
>>
>>
>> Clearing the cache and restarting NetBeans does not solve the problem.
>>
>>
>>
>> This problem did not occur on NetBeans 8.2 or NetBeans 11.0/11.1.
>>
>>
>>
>> It seems to be related to there being two classes (in different modules)
>> with the same class name. NetBeans 11.2 only seems to 'index' the first of
>> the two and indicates the error on al imports of the second one.
>>
>>
>>
>> When building the project however, there is no problem. Only the
>> incorrect error annotations on the files. I am using NetBeans 11.2 together
>> with the nb-javac plugin.
>>
>>
>>
>> Is there any means of clearing this invalid error?
>>
>> --
>>
>> In the mountains of truth, you never climb in vain - Nietzsche
>> #-------------------------------------------------------------
>>  \_O
>> ,__/>
>>   <"
>>    '
>>
>
>
> --
> In the mountains of truth, you never climb in vain - Nietzsche
> #-------------------------------------------------------------
>  \_O
> ,__/>
>   <"
>    '
>

Re: NetBeans 11.2 "cannot find symbol" error

Posted by Humphrey Clerx <hc...@gmail.com>.
Slightly modifying a file with an error badge doesn't solve the problem.
And it doesn't involve any enum classes. Somehow NetBeans "forgets" the
first class when it parses/indexes/caches the second one with the same name
(in a different module).

On Sat, Nov 23, 2019 at 1:19 AM Eirik Bakke <eb...@ultorg.com> wrote:

> Is this a Maven or an Ant project?
>
>
>
> If you open up the source for _each_ of the classes involved, including
> classes imported by the class with an error icon on it, insert a space
> somewhere, and save it (to trigger Compile-on-Save), does the error go away?
>
>
>
> Are there, by any chance, any "enum" classes involved? What about
> annotations? (E.g. "@Nullable".)
>
>
>
> (I've had quite a few of these errors myself, but possibly in different
> situations.)
>
>
>
> -- Eirik
>
>
>
> *From:* Humphrey Clerx <hc...@gmail.com>
> *Sent:* Friday, November 22, 2019 4:36 AM
> *To:* users@netbeans.apache.org
> *Subject:* NetBeans 11.2 "cannot find symbol" error
>
>
>
> I've recently installed NetBeans 11.2 and found a problem that a lot of
> files are marked with an "error" symbol that a certain class cannot be
> found, annotated by an "cannot find symbol" icon on an import statement
> even though the class to be imported exists.
>
>
>
> Clearing the cache and restarting NetBeans does not solve the problem.
>
>
>
> This problem did not occur on NetBeans 8.2 or NetBeans 11.0/11.1.
>
>
>
> It seems to be related to there being two classes (in different modules)
> with the same class name. NetBeans 11.2 only seems to 'index' the first of
> the two and indicates the error on al imports of the second one.
>
>
>
> When building the project however, there is no problem. Only the incorrect
> error annotations on the files. I am using NetBeans 11.2 together with the
> nb-javac plugin.
>
>
>
> Is there any means of clearing this invalid error?
>
> --
>
> In the mountains of truth, you never climb in vain - Nietzsche
> #-------------------------------------------------------------
>  \_O
> ,__/>
>   <"
>    '
>


-- 
In the mountains of truth, you never climb in vain - Nietzsche
#-------------------------------------------------------------
 \_O
,__/>
  <"
   '

RE: NetBeans 11.2 "cannot find symbol" error

Posted by Eirik Bakke <eb...@ultorg.com>.
Is this a Maven or an Ant project?

If you open up the source for _each_ of the classes involved, including classes imported by the class with an error icon on it, insert a space somewhere, and save it (to trigger Compile-on-Save), does the error go away?

Are there, by any chance, any "enum" classes involved? What about annotations? (E.g. "@Nullable".)

(I've had quite a few of these errors myself, but possibly in different situations.)

-- Eirik

From: Humphrey Clerx <hc...@gmail.com>
Sent: Friday, November 22, 2019 4:36 AM
To: users@netbeans.apache.org
Subject: NetBeans 11.2 "cannot find symbol" error

I've recently installed NetBeans 11.2 and found a problem that a lot of files are marked with an "error" symbol that a certain class cannot be found, annotated by an "cannot find symbol" icon on an import statement even though the class to be imported exists.

Clearing the cache and restarting NetBeans does not solve the problem.

This problem did not occur on NetBeans 8.2 or NetBeans 11.0/11.1.

It seems to be related to there being two classes (in different modules) with the same class name. NetBeans 11.2 only seems to 'index' the first of the two and indicates the error on al imports of the second one.

When building the project however, there is no problem. Only the incorrect error annotations on the files. I am using NetBeans 11.2 together with the nb-javac plugin.

Is there any means of clearing this invalid error?

--
In the mountains of truth, you never climb in vain - Nietzsche
#-------------------------------------------------------------
 \_O
,__/>
  <"
   '