简体   繁体   中英

How do I tell a compiler to “ignore” a class?

In my project, I have a non-essential class that does not work right now. I made some changes to other classes, and want to test them out. I commented out all the references to the class, and no errors are returned from them. The only problems are in the bad class. However, I receive an exception anyways. How can I basically "comment out" an entire class without deleting or moving it? I'm using Eclipse.

You could try excluding class from build path in your IDE. In Eclipse it's right click → Build Path → Exclude

Netbeans and others should have similar option (for Netbeans try Project -> Properties -> Sources -> Includes/Excludes)

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