Re: Multiple Java Versions

Marko Srdanovic <[email protected]>
Newsgroups gmane.comp.java.cruise-control.user
Message-ID <[email protected]>
By default we use Java 1.6, but what we have done is use the "antscript" 
configuration for older projects.  The script is pretty simple and just 
wraps the default ant but explicitly sets the proper value for 
JAVA_HOME.  For example:

   #!/bin/sh
   #
   # Build with jdk 1.5 (which is not the system default)
   #

   JAVA_HOME=/path/to/jdk_1.5.0.10
   export JAVA_HOME

   ANT_CMD=${ANT_HOME}/bin/ant
   exec "$ANT_CMD" "$@"

So cruisecontrol itself uses 1.6 and any build configured with this 
script uses 1.5.

We also set the following two ant properties for javac in every project:

     <property name="ant.build.javac.source" value="1.5"/>
     <property name="ant.build.javac.target" value="1.5"/>

Hope this helps...
   -- Marko

Knuplesch, Juergen wrote:
> I dont know the answer to the question, but we simply solved the
> challenge by setting up two CC processes, one for Hava 1.4 and one for 
> Java 1.5.
>  
> Anyway you can use Java 6 to compile both projects an set the <javac> 
> Task compatibility of Ant to the wished Java version
>  
> Or
> You can fork the <javac> Task and put a different JDK on the classpath.
>  
> 
> --
> Jürgen Knuplesch                   
> 
> 
> ------------------------------------------------------------------------
> *Von:* Wong, Patrick [mailto:[email protected]]
> *Gesendet:* Freitag, 13. März 2009 22:56
> *An:* [email protected]
> *Cc:* Turbant, Nicolas
> *Betreff:* [Cruisecontrol-user] Multiple Java Versions
> 
> Hello,
> 
>  
> 
> We are currently running CruiseControl 2.7.3 on Java 5. Thus far, in 
> order to compile projects that require Java 6, we pass a property to the 
> Ant builder in order to force JAVA_HOME to point to the place where Java 
> 6 is installed. However, when trying to build a project that uses custom 
> annotations, we get the error:
> 
> package javax.annotation does not exist
> 
>  
> 
> Does the JAVA_HOME environment variable that CruiseControl is started 
> with take precedence over how Ant is called, with respect to importing 
> certain Java features?
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Cruisecontrol-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user


-- 
Marko Srdanovic
Software Engineer, Institute for Computational Biomedicine
Weill Medical College of Cornell University
1305 York Avenue (Box 140)
New York, NY 10021
http://icb.med.cornell.edu/


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.