__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
-import os.path
import re
import string
import sys
def java_where_java_home(self,version=None):
- import os.path
- jar=self.java_where_jar(version)
- home=os.path.normpath('%s/..'%jar)
- return home
+ if sys.platform[:6] == 'darwin':
+ if version is None:
+ home = '/System/Library/Frameworks/JavaVM.framework/Home'
+ else:
+ home = '/System/Library/Frameworks/JavaVM.framework/Versions/%s/Home' % version
+ else:
+ jar = self.java_where_jar(version)
+ home = os.path.normpath('%s/..'%jar)
+ if os.path.isdir(home):
+ return home
+ print("Could not determine JAVA_HOME: %s is not a directory" % home)
+ self.fail_test()
def java_where_jar(self, version=None):
ENV = self.java_ENV(version)
test = TestSCons.TestSCons()
-where_javac, java_version = test.java_where_javac()
-where_java = test.java_where_java()
+javac, java_version = test.java_where_javac()
+java = test.java_where_java()
-# where_java_home=test.java_where_java_home()
-os.environ['JAVA_HOME'] = test.java_where_java_home()
-
-
-
-java = where_java
-javac = where_javac
+# where_java_home=test.java_where_java_home(java_version)
+os.environ['JAVA_HOME'] = test.java_where_java_home(java_version)
###############################################################################