I am currently facing a tricky situation where in i have to compile a Java file whose package name have "enums" in it . (It was created using Java 1.4) . Currently the server on which the code is present have Java 1.5 . I need to compile the file on the server . Can any 1 assist me with it .
You can use the -source and -target flags of the javac command to specify v1.4 or v1.5. Since the original was created with 1.4, and compiled using 1.5 the compiler may warn you about generics depending on how the code is written.
Joanne Neal wrote:In that case, unless K. Tsang's suggestion of using the -source flag works (and I suspect it won't), I think your only option is to change the package name. enum is a reserved word in Java 1.5
@C Teja: And to my mind, the whole process of compiling a bunch of Java written in a long-dead version (since October 2008, according to this) into another long-dead version (R.I.P. November 2009), strikes me as a complete WOBTAM.
Far better to implement a game of "spot the management braincell", I reckon.
Isn't it funny how there's always time and money enough to do it WRONG?
Articles by Winston can be found here
subject: Need hep regarding Compiling a Java file in 1.4