javac error: Class names are only accepted if annotation processing is explicitly requested

后端 未结 12 828
余生分开走
余生分开走 2020-11-27 04:37

I get this error when I compile my java program:

error: Class names, \'EnumDevices\', are only accepted if annotation 
processing is explicitly requested
1          


        
12条回答
  •  生来不讨喜
    2020-11-27 05:20

    first download jdk from https://www.oracle.com/technetwork/java/javase/downloads/index.html. Then in search write Edit the System environment variables In open window i push bottom called Environment Variables Then in System variables enter image description here Push bottom new In field new variables write "Path" In field new value Write directory in folder bin in jdk like "C:\Program Files\Java\jdk1.8.0_191\bin" but in my OS work only this "C:\Program Files\Java\jdk1.8.0_191\bin\javac.exe" enter image description here press ok 3 times

    Start Cmd. I push bottom windows + R. Then write cmd. In cmd write "cd (your directory with code )" looks like C:\Users\user\IdeaProjects\app\src. Then write "javac (name of your main class for your program).java" looks like blabla.java and javac create byte code like (name of your main class).class in your directory. last write in cmd "java (name of your main class)" and my program start work

提交回复
热议问题