Uncompilable source code - Erroneous sym type:

前端 未结 7 1793
半阙折子戏
半阙折子戏 2020-12-06 02:20

There was error occurred in Line 14.

Exception in thread \"main\" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type:

相关标签:
7条回答
  • 2020-12-06 02:36

    I received this error after I'd changed the type of a function parameter and it was the calling page that was in error - but I didn't see this until a magical Clean and Build pointed me to the actual issue!

    0 讨论(0)
  • 2020-12-06 02:38

    The code you provided runs fine on my computer.

    I'm guessing you are using Netbeans and may be affected by a bug. Try this:

    Open the project properties, select the Build-Compiling, uncheck "Compile on save" and rerun the application. This will make sure all your source code becomes recompiled before running it.

    Link: https://forums.netbeans.org/topic43241.html

    0 讨论(0)
  • 2020-12-06 02:45

    Download/install JDK major version number the same as NetBeans.

    i.e. If You have NetBeans 9 version, but your JDK is version 10,then try use NetBeans 10 version... or download/install JDK 9 (the same as NetBeans).

    Create new java platform for new jdk installation.

    Open netbeans menubar->tools->Java Platforms->Add Platform Specify the folder that contains the Java platform as well as the sources and Javadoc needed for debugging.

    Set new java platform to your project

    Right click on project ->properties->Libraries->Java Platform->select the jdk version that same as NetBeans

    Select source format of your project

    Right click on project ->properties->Sources->Sources/binary format->select the jdk version that same as NetBeans.

    If it still gives errors like,

    Exception in thread "main" java.lang.RuntimeException: 
    at javaapplication2.JavaApplication2.main(JavaApplication2.java:1)
    C:\Users\James\AppData\Local\NetBeans\Cache\dev\executor-snippets\run.xml:111: The following error occurred while executing this line:
    C:\Users\James\AppData\Local\NetBeans\Cache\dev\executor-snippets\run.xml:68: Java returned: 1
    BUILD FAILED (total time: 1 second)
    

    do as "sinclair" has mentioned above. Open the project properties, select the Build-Compiling, uncheck "Compile on save" and rerun the application. This will make sure all your source code becomes recompiled before running it.

    0 讨论(0)
  • 2020-12-06 02:45

    in my case

    i have solved using import with package name and class name

    like this import package.class1;

    0 讨论(0)
  • 2020-12-06 02:50

    I got this error message because I copied and pasted code without including the package name. I added the package name and it was fixed.

    0 讨论(0)
  • 2020-12-06 02:53

    This is a common issue which I get while working. What I do is clean and build the project. It solves the problem.

    Right Click on the project name >> Clean and build

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