ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 9183] New: - Make a reasonable guess about the JDK
Date Thu, 16 May 2002 22:28:08 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9183>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9183

Make a reasonable guess about the JDK

           Summary: Make a reasonable guess about the JDK
           Product: Ant
           Version: 1.4.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Wrapper scripts
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: danfuzz@milk.com


Ant likes JAVA_HOME to be set, but with the following small addition to the
wrapper script, it can make a reasonable guess about it. I am only familiar
with Sun's JDKs, but I imagine that the same general technique can be used to
for other vms.

oldwd=`pwd`
jpath=`which javac 2>/dev/null`
if [ -n "$jpath" ]; then
    cd `dirname $jpath`/..
    if [ -r "lib/tools.jar" -o -r "lib/classes.zip" ]; then
        # looks like a Sun JDK
        JAVA_HOME=`pwd`
    fi
fi
cd $oldwd

Thanks for listening.

-dan

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message