Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 64282

Summary: dev-java/ant ignores JAVA_HOME
Product: Gentoo Linux Reporter: Christian Wehrfritz <airfritz>
Component: [OLD] DevelopmentAssignee: Java team <java>
Status: RESOLVED DUPLICATE    
Severity: minor    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Christian Wehrfritz 2004-09-16 08:15:10 UTC
/usr/bin/ant overrides any JAVA_HOME setting.

Reproducible: Always
Steps to Reproduce:
1. export JAVA=HOME=/opt/WebSphere/AppServer/java
2. export PATH=$JAVA_HOME/bin
3. ant

Actual Results:  
ant ignores the above settings


an easy fix would be to test if JAVA_HOME is set, before
overwriting it:
if [ -z $JAVA_HOME ] ; then
  if [ -f $HOME/.gentoo/java-env ] ; then
    source $HOME/.gentoo/java-env
  else
    JAVA_HOME=
Comment 1 Christian Wehrfritz 2004-09-16 08:15:10 UTC
/usr/bin/ant overrides any JAVA_HOME setting.

Reproducible: Always
Steps to Reproduce:
1. export JAVA=HOME=/opt/WebSphere/AppServer/java
2. export PATH=$JAVA_HOME/bin
3. ant

Actual Results:  
ant ignores the above settings


an easy fix would be to test if JAVA_HOME is set, before
overwriting it:
if [ -z $JAVA_HOME ] ; then
  if [ -f $HOME/.gentoo/java-env ] ; then
    source $HOME/.gentoo/java-env
  else
    JAVA_HOME=´java-config --jdk-home´
    CLASSPATH=´java-config --classpath´:$CLASSPATH
  fi
fi
Comment 2 Thomas Matthijs (RETIRED) gentoo-dev 2004-09-16 17:08:59 UTC
fixed for ant

*** This bug has been marked as a duplicate of 61665 ***