aspose file tools*
The moose likes Java in General and the fly likes Warning : Compiling code with JDK1.6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Warning : Compiling code with JDK1.6" Watch "Warning : Compiling code with JDK1.6" New topic
Author

Warning : Compiling code with JDK1.6

Rizwan Patel
Ranch Hand

Joined: Jan 03, 2008
Posts: 59

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!


scjp 1.5, OCPJWSD 5
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

My hint



Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

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


[Jess in Action][AskingGoodQuestions]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
Consider Paul's rocket mass heater.
 
subject: Warning : Compiling code with JDK1.6