permaculture playing cards*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Recompile with -Xlint:unchecked " Watch "Recompile with -Xlint:unchecked " New topic
Author

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


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37902
    
  22
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
ecified)
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: 14074
    
  16

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
 
Similar Threads
What should be the o/p?
Compiler warning recieved, what does it mean??
Parsing XML doubt?
Regarding Warnings in Java
Compling problem