[MOBY-dev] jMoby - java 1.5

Martin Senger senger at ebi.ac.uk
Tue Apr 19 13:34:09 UTC 2005


Dear jMoby developers,
   Eddie and me, we have updated Ant's build.xml file in order to be able 
to add to jMoby also Java sources that needs to be compiled with the 
latest Java 1.5 - but still let the others work with Java 1.4 as usual.

   Here is how to do it (please comment if you need any more assistance, 
or if you disagree with our approach):

* First to say is that it was put there as a workaround for those who
really needs to use 1.5. Any new class that needs 1.5 must be exlicitely
named in the build.xml file. Which is not too suitable if you have many 
such classes. So when you start to use Java 1.5. in greater scale we need 
to re-factor it. Let me know.

* Having said that please note that nothing prevents you to use Java 1.5
to compile all classes. That should work fine (with perhaps few semantic
warnings which I am sure the authors, including me, will take care of
sooner or later). The previous (and the next) bullets are for those
*adding* sources that can be compiled *only* with Java 1.5 (an example is
the Eddie's class org.biomoby.shared.MobyObjectDecompositionImpl.java).

* If you are using regular javac compiler you do not need to do anything
special. The Ant will sniff around and find what java version you are
using and depending on the result it will compile always all classes not
mentioned as specific for 1.5, and then - only if you have java 1.5 - it
compiles additionally those new bastards.
   Which means that when you are using java 1.4, the new (Eddie's) classes 
will not compiled so you will not be able to use them. But that's obvious 
- you cannot shop with the old Deutches Marks anymore without having new 
Euros, can you?

* If you are using jikes (which I strongly recommend because it is much
much faster compiler, but that's another story) and have Java 1.4 on your
path, again nothing needs to be done.
   However, if you are using jikes (latest version is 1.22) *and* have
java 1.5 on your path, jikes will try to compile also the new (Eddie's)  
classes and fails. I do not exactly why (let me know if you know). So for
this case you need to instruct Ant that - eventhough the java 1.5 is
available - you do not want it. Do it with by setting property 
java.latest.version to false. Either (recommended) put the line:
   java.latest.version = false
in your build.property files, or use it on the Ant's command line:
   ./build-dev.sh -Djava.latest.version=false compile

   With regard,
   Martin

-- 
Martin Senger

EMBL Outstation - Hinxton                Senger at EBI.ac.uk     
European Bioinformatics Institute        Phone: (+44) 1223 494636      
Wellcome Trust Genome Campus             (Switchboard:     494444)
Hinxton                                  Fax  : (+44) 1223 494468
Cambridge CB10 1SD
United Kingdom                           http://industry.ebi.ac.uk/~senger





More information about the MOBY-dev mailing list