println

my day-to-day experiences with software

Porting java 1.5 source code to java 1.4 with ANT

Posted by rajg on September 9, 2008

SAP NetWeaver 6.4 runs with java 1.4. In order deploy my application that was built in java 1.5 on SAP NW 6.4 I needed to first compile it “-target” option from java compile “javac”. So I tried following ant build xml snippet:

<javac srcdir=“${source}” destdir=“${destination}” source=“1.5″ target=“1.4″ debug=“true” optimize=“true” />

But it didn’t work. After looking at http://www.masutti.ch/eel/index.html I found a trick to make to above snippet work with the following change:

<javac srcdir=“${source}” destdir=“${destination}” source=“1.5″ target=“jsr14″ debug=“true” optimize=“true” />

One should keep in mind that you cannot replace new classes from java 1.5 with this technique. If possible you can provide additional jars that work with 1.4 (For e.g. classes from javax.management.* package).

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

 
Follow

Get every new post delivered to your Inbox.