Sunday, April 27, 2014

Eclipse IDE: Turning Off Compiler Warnings

     I found that when writing Android code, Eclipse tends to pop up a lot of warnings that aren't necessary. One of the biggest is variables that aren't being used. Sometimes I like to add in the variables before I ever use them, thus a warning is thrown by Eclipse. This short guide will show you how to remove these warnings.

To begin, in Eclipse go to  Project > Properties > Java Compiler > Errors/Warnings.

You will see this:

The Errors/Warnings menu in Eclipse IDE

There is a box at the top that says "Enable project specific settings." You will want to check that box.

From there, you can go through each setting and enable or disable the warnings as you see fit.

The one I was looking for was under unnecessary code:

Variables not used set to warning. Can be changed to ignore



Setting: Value of local variable is not used to ignore will stop those pesky warnings from appearing.

After changing settings, hit apply and it will prompt you to recompile your project. 

These settings can be reversed at any time but a recompile will be necessary. 








No comments:

Post a Comment