aspose file tools*
The moose likes Beginning Java and the fly likes how do I disable compiler warnings--not errors? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "how do I disable compiler warnings--not errors?" Watch "how do I disable compiler warnings--not errors?" New topic
Author

how do I disable compiler warnings--not errors?

Brian LaRue
Ranch Hand

Joined: Feb 01, 2006
Posts: 45
I don't know what I've done, but when compiling into bytecode, the compiler will sometimes give me a warning message after compilation. Is there a way to disable these types of messages? The most common type of "Warning" message is that my local variable is never read. I know that this is potentially a problem, but I'm in the middle of development and code which will later use those local variables is soon to come. It's just more of an annoyance then helpful advice. Here's an example:


Is there a switch or something to ignore warnings and only stop on errors? Or did I foul something up during installation? I'm not using an IDE, I'm typing up .java files in a text editor and compiling from a terminal.

Thanks,

Brian
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Brian LaRue:
...I'm not using an IDE, I'm typing up .java files in a text editor and compiling from a terminal...

But is "javac" actually Sun's compiler? These look like Eclipse messages.

What OS and Java version are you running?


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
javac -nowarn Main.java


Merrill
Consultant, Sima Solutions
Brian LaRue
Ranch Hand

Joined: Feb 01, 2006
Posts: 45
Ah, I should have known. I did install Eclipse to try it out but have since uninstalled it. I'll bet it's still lingering around and taking over my 'javac' by Sun.

I'm using Ubuntu (Feisty) and


anyone know how to fix this one? how does someone switch back to the Sun version of 'javac'? Does Eclipse modify your CLASSPATH to point to it's own compiler?
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
Just remove the entry in the PATH that pointed to that version of javac.
 
 
subject: how do I disable compiler warnings--not errors?