File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Head First Android this week in the Android 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\ 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: 43350
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, write
javac -Xlint

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 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: 14915

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

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: Recompile with -Xlint:unchecked
It's not a secret anymore!