• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JDK 5.0 install issue!

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm getting ready to use Professional Java JDK 5 but I'm getting an error when upgrading from jdk 1.4 to jdk 1.5. When I try to compile code, I get:

Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

But when I compile using "javac -source 1.4 jakarta-tomcat-5......"
it works. Obviously it is not finding the new version of jre 1.5 and still using the previous 1.4. How can I solve this problem?

Thank you.
 
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This isn't an error; it's a warning. One cause is using any of the Collections classes without specifying their contained type (generics).
 
Robert Bonslater
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your reply!

Could you please specify what this would require me to do? What do you mean by specify Collections classes contained type (generic)? I'm not catching on.
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JDK 5.0 introduced generics, a form of class typing similar to C++'s templates. When you declare a Collection, you can specify the types of objects it can contain.If you'd like to see all the warnings, you can useas the note says.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At least your compiler is the right version as this warning is generated only by 1.5.0 (and up).
If you try to run the generated classes and you get an error about incorrect classfile version numbers you need to make sure you don't have an old 1.4 java and/or javaw executable being found on your system path before the 1.5 version is found (can happen on some systems).
reply
    Bookmark Topic Watch Topic
  • New Topic