• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Warning : Compiling code with JDK1.6

 
Rizwan Patel
Ranch Hand
Posts: 59
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am facing below problem while compiling the source code.


I had the code which is written and compiled using the JDK1.4 now as I want to update that to JDK 1.6 i am facing the above problem at various places.
As it is a warning displayed everytime, i want to know whether there is any way around apart from changing the code.

Please help!
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My hint

 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to update the code, then you need to add the casts; that's part of what updating the code would mean!

If you just want the warnings to go away, you could compile in JDK 1.4 compatibility mode

javac -source 1.4 -target 1.4 Foo.java
 
Rob Spoor
Sheriff
Pie
Posts: 20610
63
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ernest Friedman-Hill:
If you want to update the code, then you need to add the casts; that's part of what updating the code would mean!

Or, in this case, remove the null from invoke:

Because varargs allow you to pass zero elements, which will be treated as an array of size zero.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic