Lines 1947-1953
Link Here
|
1947 |
paths[i], customEncoding, false, true); |
1947 |
paths[i], customEncoding, false, true); |
1948 |
} |
1948 |
} |
1949 |
} else { |
1949 |
} else { |
1950 |
final File javaHome = getJavaHome(); |
|
|
1951 |
bootclasspaths = new ArrayList(DEFAULT_SIZE_CLASSPATH); |
1950 |
bootclasspaths = new ArrayList(DEFAULT_SIZE_CLASSPATH); |
1952 |
/* no bootclasspath specified |
1951 |
/* no bootclasspath specified |
1953 |
* we can try to retrieve the default librairies of the VM used to run |
1952 |
* we can try to retrieve the default librairies of the VM used to run |
Lines 1961-1996
Link Here
|
1961 |
} |
1960 |
} |
1962 |
|
1961 |
|
1963 |
/* |
1962 |
/* |
1964 |
* Handle >= JDK 1.2.2 settings: retrieve rt.jar |
1963 |
* Handle >= JDK 1.2.2 settings: retrieve the bootclasspath |
1965 |
*/ |
1964 |
*/ |
1966 |
if (javaHome != null) { |
1965 |
// check bootclasspath properties for Sun, JRockit and Harmony VMs |
1967 |
File[] directoriesToCheck = null; |
1966 |
String bootclasspathProperty = System.getProperty("sun.boot.class.path"); //$NON-NLS-1$ |
1968 |
if (System.getProperty("os.name").startsWith("Mac")) {//$NON-NLS-1$//$NON-NLS-2$ |
1967 |
if ((bootclasspathProperty == null) || (bootclasspathProperty.length() == 0)) { |
1969 |
directoriesToCheck = new File[] { |
1968 |
// IBM J9 VMs |
1970 |
new File(javaHome, "../Classes"), //$NON-NLS-1$ |
1969 |
bootclasspathProperty = System.getProperty("vm.boot.class.path"); //$NON-NLS-1$ |
1971 |
}; |
1970 |
} |
1972 |
} else { |
1971 |
if ((bootclasspathProperty == null) || (bootclasspathProperty.length() == 0)) { |
1973 |
directoriesToCheck = new File[] { |
1972 |
// Harmony using IBM VME |
1974 |
new File(javaHome, "lib") //$NON-NLS-1$ |
1973 |
bootclasspathProperty = System.getProperty("org.apache.harmony.boot.class.path"); //$NON-NLS-1$ |
1975 |
}; |
1974 |
} |
1976 |
} |
1975 |
if ((bootclasspathProperty != null) && (bootclasspathProperty.length() != 0)) { |
1977 |
File[][] systemLibrariesJars = getLibrariesFiles(directoriesToCheck); |
1976 |
StringTokenizer tokenizer = new StringTokenizer(bootclasspathProperty, File.pathSeparator); |
1978 |
if (systemLibrariesJars != null) { |
1977 |
String token; |
1979 |
for (int i = 0, max = systemLibrariesJars.length; i < max; i++) { |
1978 |
while (tokenizer.hasMoreTokens()) { |
1980 |
File[] current = systemLibrariesJars[i]; |
1979 |
token = tokenizer.nextToken(); |
1981 |
if (current != null) { |
1980 |
FileSystem.Classpath currentClasspath = FileSystem |
1982 |
for (int j = 0, max2 = current.length; j < max2; j++) { |
1981 |
.getClasspath(token, customEncoding, null); |
1983 |
FileSystem.Classpath classpath = |
1982 |
if (currentClasspath != null) { |
1984 |
FileSystem.getClasspath(current[j].getAbsolutePath(), |
1983 |
bootclasspaths.add(currentClasspath); |
1985 |
null, false, null, null); |
1984 |
} |
1986 |
if (classpath != null) { |
1985 |
} |
1987 |
bootclasspaths.add(classpath); |
1986 |
} else { |
|
|
1987 |
// try to get all jars inside the lib folder of the java home |
1988 |
final File javaHome = getJavaHome(); |
1989 |
if (javaHome != null) { |
1990 |
File[] directoriesToCheck = null; |
1991 |
if (System.getProperty("os.name").startsWith("Mac")) {//$NON-NLS-1$//$NON-NLS-2$ |
1992 |
directoriesToCheck = new File[] { |
1993 |
new File(javaHome, "../Classes"), //$NON-NLS-1$ |
1994 |
}; |
1995 |
} else { |
1996 |
// fall back to try to retrieve them out of the lib directory |
1997 |
directoriesToCheck = new File[] { |
1998 |
new File(javaHome, "lib") //$NON-NLS-1$ |
1999 |
}; |
2000 |
} |
2001 |
File[][] systemLibrariesJars = getLibrariesFiles(directoriesToCheck); |
2002 |
if (systemLibrariesJars != null) { |
2003 |
for (int i = 0, max = systemLibrariesJars.length; i < max; i++) { |
2004 |
File[] current = systemLibrariesJars[i]; |
2005 |
if (current != null) { |
2006 |
for (int j = 0, max2 = current.length; j < max2; j++) { |
2007 |
FileSystem.Classpath classpath = |
2008 |
FileSystem.getClasspath(current[j].getAbsolutePath(), |
2009 |
null, false, null, null); |
2010 |
if (classpath != null) { |
2011 |
bootclasspaths.add(classpath); |
2012 |
} |
1988 |
} |
2013 |
} |
1989 |
} |
2014 |
} |
1990 |
} |
2015 |
} |
1991 |
} |
2016 |
} |
1992 |
} |
2017 |
} |
1993 |
} |
2018 |
} |
1994 |
} |
2019 |
} |
1995 |
return bootclasspaths; |
2020 |
return bootclasspaths; |
1996 |
} |
2021 |
} |