xml-xmlbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Brandt <s...@bwcgroup.com>
Subject [PATCH] Add to ways to find javac in CodeGenUtil
Date Tue, 16 Sep 2003 12:57:33 GMT
The code assumes that java.home is pointing to the jre directory inside 
an sdk install ( which IMHO is incorrect ). This patch tests for javac 
in {java.home}/bin/javac{.exe} as well as the odd ../bin location it 
previously searched.

-Sean

-----
Index: src/xmlcomp/org/apache/xmlbeans/impl/tool/CodeGenUtil.java
===================================================================
RCS file: 
/home/cvspublic/xml-xmlbeans/v1/src/xmlcomp/org/apache/xmlbeans/impl/tool/CodeGenUtil.java,v
retrieving revision 1.1
diff -u -r1.1 CodeGenUtil.java
--- src/xmlcomp/org/apache/xmlbeans/impl/tool/CodeGenUtil.java  15 Sep 
2003 18:20:33 -0000      1.1
+++ src/xmlcomp/org/apache/xmlbeans/impl/tool/CodeGenUtil.java  16 Sep 
2003 12:57:00 -0000
@@ -401,6 +401,16 @@
             return result;
         }
 
+       result = new File(home + sep + "bin",tool);
+       if ( result.isFile()) {
+               return result;
+       }
+
+        result = new File(result.getPath() + ".exe");
+        if (result.isFile()) {
+            return result;
+        }
+
         // just return the original toolFile and hope that it is on the 
PATH.
         return toolFile;
     }



- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message