Java compilation error: switch on enum

后端 未结 3 1243
梦谈多话
梦谈多话 2021-01-20 17:54

I came across a very weird error that I just can\'t figure out how to solve.

A project, that compiles just fine on Windows, doesn\'t compile on Linux with the follow

3条回答
  •  遥遥无期
    2021-01-20 18:33

    The problem should go away if u r using JDK1.7 .Try following the below steps and see

    1. Open the project properties
    2. Click on "Java Compiler"
    3. Checkmark "Enable project specific settings"
    4. Set all of the drop down menus to 1.7
    5. Hit ok
    6. Clean the project to trigger a rebuild

    If u do below , then the problem reappears.

    1. Open the project properties
    2. Click on "Java Compiler"
    3. Clear "Enable project specific settings"
    4. Hit ok
    5. Clean the project to trigger a rebuild (it will rebuild automatically)

    Here's what I see if I do the following...

    1. Open the project properties
    2. Click on "Java Compiler"
    3. Click on "Configure Workspace Settings"
    4. I see that the "Compiler compliance level" = 1.7
    5. I see that "Use default compliance settings" is checked.

    Hope this helps!!

提交回复
热议问题