ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/extensions DefaultExtensionManager.java
Date Fri, 29 Mar 2002 12:55:04 GMT
donaldp     02/03/29 04:55:04

  Modified:    proposal/myrmidon/src/java/org/apache/myrmidon/components/extensions
                        DefaultExtensionManager.java
  Log:
  Under deian the tools.jar is put in a different location - *sigh*
  
  Revision  Changes    Path
  1.7       +27 -4     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/extensions/DefaultExtensionManager.java
  
  Index: DefaultExtensionManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/extensions/DefaultExtensionManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultExtensionManager.java	16 Mar 2002 04:08:06 -0000	1.6
  +++ DefaultExtensionManager.java	29 Mar 2002 12:55:04 -0000	1.7
  @@ -27,16 +27,27 @@
    * PhoenixPackageRepository
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.6 $ $Date: 2002/03/16 04:08:06 $
  + * @version $Revision: 1.7 $ $Date: 2002/03/29 12:55:04 $
    */
   public class DefaultExtensionManager
       extends DefaultPackageRepository
       implements LogEnabled, Parameterizable, Initializable, Disposable, ExtensionManager
   {
  -    private final static Resources REZ =
  +    private static final Resources REZ =
           ResourceManager.getPackageResources( DefaultExtensionManager.class );
   
  -    private final static String TOOLS_JAR = File.separator + "lib" + File.separator + "tools.jar";
  +    /**
  +     * The standard location of tools.jar for IBM/Sun JDKs.
  +     */
  +    private static final String TOOLS_JAR =
  +        File.separator + "lib" + File.separator + "tools.jar";
  +
  +    /**
  +     * The path relative to JRE in which tools.jar is located.
  +     */
  +    private static final String DEBIAN_TOOLS_JAR =
  +        File.separator + ".." + File.separator + "j2sdk1.3" +
  +        File.separator + "lib" + File.separator + "tools.jar";
   
       private Logger m_logger;
   
  @@ -107,7 +118,19 @@
               jdkHome = javaHome;
           }
   
  -        final File tools = new File( jdkHome + TOOLS_JAR );
  +        //We need to search through a few locations to locate tools.jar
  +        File tools = new File( jdkHome + TOOLS_JAR );
  +        if( tools.exists() )
  +        {
  +            return tools;
  +        }
  +
  +        //The path to tools.jar. In some cases $JRE_HOME is not equal to
  +        //$JAVA_HOME/jre. For example, on Debian, IBM's j2sdk1.3 .deb puts
  +        //the JRE in /usr/lib/j2sdk1.3, and the JDK in /usr/lib/j2re1.3,
  +        //tools.jar=${java.home}/../j2sdk1.3/lib/tools.jar
  +        tools = new File( jdkHome + DEBIAN_TOOLS_JAR );
  +
           if( !tools.exists() )
           {
               final String message = REZ.getString( "extension.missing-tools.error" );
  
  
  

--
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