• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error messages after porting to Java 5  RSS feed

 
Ahmet Aksoy
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm using Eclipse.
I was using Java 1.4, and now trying to use Java 5.
I have a project which I compiled and run under Java 1.4.
After installing Java 5, I can re-compile and re-run the same project on eclipse with no problems.
However, when I try to compile, make jar, and make zip with Ant, I get the following messages. Anyway, jar and zip files work normally.
Here are the messages:

java:
[mkdir] Created dir: C:\eclipse\workspace\belletmen\build\classes
[javac] Compiling 21 source files to C:\eclipse\workspace\belletmen\build\classes
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[copy] Copied 6 empty directories to 5 empty directories under C:\eclipse\workspace\belletmen\build

I can't find which files are are using "unchecked" or "unsafe" operations.
What should I do?
Thanks.
Ahmet Aksoy
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As you can tell by the fact that the compiled classes work as expected, these are warnings, not errors. To get more details, follow the instructions given:


[javac] Note: Recompile with -Xlint:unchecked for details.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As EFH says, these are warnings not errors. They have to do with using classes from the API that have been re-written to take advantage of the new generics feature. This is most common when using the Collections Framework. If this is production code, you should probably not worry much about this too much at the moment. Eventually, you will want to modify your code to use the extra compile-time type-checking that generics provide. If you follow the directions by using the given compiler flag, you can find out which lines of code are directly effected. However, changing those lines will invariable break things else where. This is why I recommend that you take porting to JDK 1.5 in baby steps in production code.

Layne
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!