Bug 24694 - JAVA_HOME should be exported
Summary: JAVA_HOME should be exported
Status: REOPENED
Alias: None
Product: Ant
Classification: Unclassified
Component: Wrapper scripts (show other bugs)
Version: 1.5.4
Hardware: Macintosh All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-13 23:35 UTC by Levi Brown
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Levi Brown 2003-11-13 23:35:36 UTC
The new ant wrapper shell script automatically determines what the JAVA_HOME variable should be 
set to, but it should also export the variable so the entire ant build process can have access to it.  
For instance, I use ant to build my java files, create my native JNI headers using javah, and then to 
compile the native code by exec-ing a shell script which I populate from the ant buildl.xml.  Within 
this script I need to know where JAVA_HOME is so I can include the jni.h file in my C compilation 
path.  Previous to your new wrapper script, I had my own, which exported JAVA_HOME and all 
worked wonderfully.

I have made the following one line change to your script and would suggest something similar:

case "`uname`" in
  CYGWIN*) cygwin=true ;;
  Darwin*) darwin=true
           if [ -z "$JAVA_HOME" ] ; then
             JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
             export JAVA_HOME
           fi
           ;;
esac

Thanks for listening, and keep up the excellent work!  Ant is great!

Cheers,

Levi
Comment 1 Stefan Bodewig 2005-03-17 16:35:36 UTC

*** This bug has been marked as a duplicate of 24553 ***
Comment 2 Levi Brown 2005-03-17 17:07:58 UTC
This bug was closed because "This bug has been marked as a duplicate of 24553" which is incorrect.  
Bug 24553 is dealing with ANT_HOME, while this bug is related to JAVA_HOME which are completely 
different.
Comment 3 Stefan Bodewig 2005-03-17 17:14:10 UTC
Oops, yes, sorry.