wood burning stoves 2.0*
The moose likes Java in General and the fly likes Recompile with -Xlint:unchecked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Recompile with -Xlint:unchecked " Watch "Recompile with -Xlint:unchecked " New topic

Recompile with -Xlint:unchecked

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Note: C:\Documents and Settings\sai\Desktop\Test.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

why i am getting this warning while i am compiling my program i am using util package arraylist class inside the program

and how to use this -xlint function ?

thanks in advance

SCJP 1.4
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38441
It's -Xlint not -xlint.

Lint is a tool which shows details of potential errors or vulnerabilities recognised by the compiler. So to show the full details, rather than writing
javac Test.java, write
javac -Xlint Test.java

And you have already told us why you are getting an error. It is because you are not using generics correctly on your ArrayList.
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
now i've tried this using -Xlint tool
and i got this error message
Test.java:2: error while writing Test: Xlint\Test.class (The system cannot find the path sp
public class Test {
1 error

can you please tell me now what should i do to eliminate that warning?

thanking you in advance
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14114

You are typing in something wrong on the command line. The message says:

Note: Recompile with -Xlint:unchecked for details.

So, it's very simple. Do exactly what the message says: add "-Xlint:unchecked" to the command line, like this:

javac -Xlint:unchecked Test.java

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
I agree. Here's the link: http://aspose.com/file-tools
subject: Recompile with -Xlint:unchecked