Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with Compiling Generics.

 
Suresh Rajadurai
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,

when I tried to compile the following code with

javac test.java

it gives the following message in the dos prompt:

Note: test.java used unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.



Then when I compiled with the following command:

javac -Xlint:unchecked test.java

it gives the following error messages:

javac: invalid flag: -xlint:unchecked
Usage: javac <options> <sourcefiles>
use -help for a list of possible options.



Could you guys PLEASE throw me some light on this annoying messages PLEASE.




Thanks & regards

Suresh.
 
Piet Verdriet
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange, when compiling your code like this:

I get the following message:

It looks like you compiled your source file with two different compilers... Anyway, you should replace your line:

by:

to make the warning disappear.
 
Suresh Rajadurai
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic