• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Error messages after porting to Java 5

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
What are you saying? I thought you said that Santa gave you that. And this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic