aspose file tools
The moose likes Beginning Java and the fly likes Need hep regarding Compiling a Java file in 1.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Need hep regarding Compiling a Java file in 1.4 " Watch "Need hep regarding Compiling a Java file in 1.4 " New topic
Author

Need hep regarding Compiling a Java file in 1.4

C Teja
Greenhorn

Joined: Feb 28, 2013
Posts: 2
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
Ranch Hand

Joined: Sep 13, 2007
Posts: 1222

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.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3011
    
    9
C Teja wrote:whose package name have "enums" in it

enums or enum ?


Joanne
C Teja
Greenhorn

Joined: Feb 28, 2013
Posts: 2
Joanne Neal wrote:
C Teja wrote:whose package name have "enums" in it

enums or enum ?

Appologies I mean enum
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3011
    
    9
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

Joined: Mar 17, 2011
Posts: 4761
    
    7

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

Isn't it funny how there's always time and money enough to do it WRONG?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Need hep regarding Compiling a Java file in 1.4
 
Similar Threads
What do I need in order to compile a servlet
Create file in java and write it to a different server on a different network
using javac to compile a cvs controlled project
compile servlets from command line in resin.
Java version in build file