Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need hep regarding Compiling a Java file in 1.4

 
C Teja
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
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 .

Thanks In Advance ....



 
K. Tsang
Bartender
Posts: 3521
16
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

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
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C Teja wrote:whose package name have "enums" in it

enums or enum ?
 
C Teja
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joanne Neal wrote:
C Teja wrote:whose package name have "enums" in it

enums or enum ?

Appologies I mean enum
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
C Teja wrote:
Appologies I mean enum

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
 
Winston Gutkowski
Bartender
Pie
Posts: 10527
64
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Winston
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic