File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Recompile with -Xlint:unchecked

 
saikrishna cinux
Ranch Hand
Posts: 689
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Campbell Ritchie
Sheriff
Pie
Posts: 47300
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 689
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic