The Type of is erroneous error in netbeans

前端 未结 9 1653
梦如初夏
梦如初夏 2021-01-11 11:26

I have defined two classes for a java program I am writing, call them Class1 and Class2. In the body of the constructor for Class1, I call the constructor for class 2. Howev

相关标签:
9条回答
  • 2021-01-11 11:52

    Grease's answer re deleting the contents of netbeans cache works. I'm using Netbeans 8.1 on MacOS Sierra.

    Deleted everything under "/Users//Library/Caches/NetBeans/8.1/"

    0 讨论(0)
  • 2021-01-11 11:53

    I decided to stop/restart NetBeans 8.2 before taking the "nuclear" approach. The error was gone when I got back in.

    0 讨论(0)
  • 2021-01-11 12:01

    I got the same issue and fixed using the excepted answer, as I'm using windows 10 so here is the cache folder location:

    C:\Users\USER_NAME\AppData\Local\NetBeans\Cache\8.1

    AppData is a hidden folder.

    0 讨论(0)
  • 2021-01-11 12:05

    I would have preferred to leave this as a comment but as I do not have the reputation I couldn't. I realise this is also a very late response but don't know if you have found the answer or not. I came across this while googling for an answer myself.

    I also believe that this error is unrelated to the code but is rather an error created by NetBeans. I found the same code compiled and ran fine in NetBeans on one machine but not the on the other where I had first encountered the error.

    The solution for me was to close NetBeans, clear the NetBeans cache and restart NetBeans. I was using version 8.0 and the location of the cache for me is:

    ~/.cache/netbeans/8.0/

    I deleted everything in the folder and on the next run everything was fine.

    For older versions I believe the cache may be in a different location which can be found by opening the about window from the help menu.

    0 讨论(0)
  • 2021-01-11 12:05

    I had the same issue on netbeans 8.0. The following trick should fix it:

    Right click on the project -> properties -> build -> compiling ==> uncheck "compile on save" then click ok

    0 讨论(0)
  • 2021-01-11 12:08

    I faced this issue. I solved it by adding all dependent jars to the project/file

    0 讨论(0)
提交回复
热议问题