java.lang.RuntimeException: Uncompilable source code - what can cause this?

后端 未结 15 2032
梦谈多话
梦谈多话 2020-11-22 16:30

This error is just bizarre, my code compiles fine, I can see there are no problems with it, yet this error has just popped up. I have tried re-starting NetBeans and there is

相关标签:
15条回答
  • 2020-11-22 17:15

    Implementing my own functional interfaces resolved this for me (so instead of using java.util.function.* just create your own single-method interface with the parameters and return-type you want).

    0 讨论(0)
  • 2020-11-22 17:16

    Organize your code as a maven module. Once done run the command from terminal
    $mvn installl
    to check if your code builds fine.
    Finally import the project in netbeans or eclipse as maven project.

    0 讨论(0)
  • 2020-11-22 17:19

    If you are using Netbeans, try to hit the Clean and Build button, let it do the thing and try again. Worked for me!

    0 讨论(0)
  • 2020-11-22 17:21

    I guess you are using an IDE (like Netbeans) which allows you to run the code even if certain classes are not compilable. During the application's runtime, if you access this class it would lead to this exception.

    0 讨论(0)
  • 2020-11-22 17:21

    I also got the same error and I did clean build and it worked.

    0 讨论(0)
  • 2020-11-22 17:24

    change the package of classes, your files are probably in the wrong package, happened to me when I copied the code from a friend, it was the default package and mine was another, hence the netbeans could not compile because of it.

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