• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

jvm version used by ant

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm running Ant from Eclipse, and the two seem to disagree on what version of Java (both compiler and jvm) to use: Eclipse uses 1.4, and Ant insists on 1.3. The exact same source file compiles directly from Eclipse, but not from an ant task invoked from Eclipse. How do I tell Ant what version of Java to use?

(Java 1.5 is not available yet for the Mac, as I understand it... and if it were, it wouldn't run on MacOS 10.2.8, which I haven't upgraded to 10.3 yet because 10.4 is coming Any Month Now. When that happens, I'll be upgrading OS, Java, Eclipse, and Ant all at once....)


Addendum: I've tried setting "build.compiler" earlier in the ant buildfile; no dice. I tried "ant.build.compiler"; ditto. I tried putting 'compiler="javac1.4"' in each individual <javac> task; no dice. However, I seem to have managed it by putting 'executable="/usr/bin/javac"' in each individual <javac> task. There must be a better way, but at least I've got a workaround for the moment....
[ December 01, 2004: Message edited by: Stephen Bloch ]
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does your "JAVA_HOME" environment variable look like?
 
Stephen Bloch
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JAVA_HOME is set (on my Mac) to /Library/Java/Home, which contains three directories: bin, include, and lib. The bin directory contains symlinks to java, javac, javadoc, jdb, jar, etc. in /System/Library/Frameworks/JavaVM.framework/Versions/1.4.1/bin. The command

${JAVA_HOME}/bin/java -version

reports 1.4.1_01.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What does it report when you just type

java -version

?
 
Stephen Bloch
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Same: 1.4.1_01 .
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try the -debug option for Ant, perhaps it's giving you some hints on what's going on...
 
Do not threaten THIS beaver! Not even with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic