简体   繁体   中英

How to reenable compiler warnings in Eclipse?

I'm working on a Tomcat WebApp with Servlets, with the Eclipse Project being a JavaScript one. However, I need to get the Java compiler to control the .java files so that I can get the appropriate IDE features.

I've installed a Java perspective and language plugins via Install New Software, and restarted Eclipse. Everything threw errors then, including stuff like import java.io.*; .

I've Cleaned the project and in the meantime checked the Java Build Path in the Project's Properties. It seems to be all correct, using JRE System library [jre1.8.0_101] . After the validation finished I've restarted Eclipse again.

Nothing throws errors now. I've added a contextually nonsense statements of Seriously hello = new What(); where neither Seriously nor What are defined anywhere and it doesn't throw anything.

In fact, removing the semi-colons doesn't throw an error either, as if there was no Compilation overlooking the files at all.


Edit:
So I've deleted everything non-sourcey, and then recreated the project in Eclipse as a Faceted Project. This did not help. I'm thinking that maybe my Eclipse installation is bugged due to my blind installing of plugins.

I've still no clue how to fix this. :(

The source folder needs to include the .java files, otherwise the compiler just ignores them.

You set it at
Project->Properties->Java Build Path->Source tab

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM