Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using multiple JDK for the same build script

 
Raj Chukka
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have JDK 1.3.1 on Unix and (JDK 1.4.2) on windows. I have build.xml file which should take the different JDK's based on the OS. I got the following solutions for it.

1. Declare <property> in ant script like below and change it accodingly.

<property name="java.home" value="JDK_HOME_PATH"/>

2. I create a properties file for each env like below.

in unix:
<property file="jdk_unix.properties"/>

in windows
<property file="jdk_windows.properties"/>

whenever i run the build.xml, i will comment the other properties file.

is there any other way i can do this without any modifications on the build file?

Thanks in advance.

Thanks,
Raj Chukka
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do this. In build.xml, have:



Then in build.properties have (using your locations, of course):



Then if you change or move the JDKs, you need update only the properties file.

P.S. Even this would work:



In this, the Windows setting is the default.
[ October 16, 2008: Message edited by: Peter Johnson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic