View | Details | Raw Unified | Return to bug 188648 | Differences between
and this patch

Collapse All | Expand All

(-)batch/org/eclipse/jdt/internal/compiler/batch/Main.java (-25 / +45 lines)
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
			bootclasspathProperty = System.getProperty("vm.boot.class.path"); //$NON-NLS-1$
1970
					new File(javaHome, "../Classes"), //$NON-NLS-1$
1969
		}
1971
				};
1970
		if ((bootclasspathProperty != null) && (bootclasspathProperty.length() != 0)) {
1972
			} else {
1971
			StringTokenizer tokenizer = new StringTokenizer(bootclasspathProperty, File.pathSeparator);
1973
				directoriesToCheck = new File[] {
1972
			String token;
1974
					new File(javaHome, "lib") //$NON-NLS-1$
1973
			while (tokenizer.hasMoreTokens()) {
1975
				};
1974
				token = tokenizer.nextToken();
1976
			}
1975
				FileSystem.Classpath currentClasspath = FileSystem
1977
			File[][] systemLibrariesJars = getLibrariesFiles(directoriesToCheck);
1976
						.getClasspath(token, customEncoding, null);
1978
			if (systemLibrariesJars != null) {
1977
				if (currentClasspath != null) {
1979
				for (int i = 0, max = systemLibrariesJars.length; i < max; i++) {
1978
					bootclasspaths.add(currentClasspath);
1980
					File[] current = systemLibrariesJars[i];
1979
				}
1981
					if (current != null) {
1980
			}
1982
						for (int j = 0, max2 = current.length; j < max2; j++) {
1981
		} else {
1983
							FileSystem.Classpath classpath =
1982
			// try to get all jars inside the lib folder of the java home
1984
								FileSystem.getClasspath(current[j].getAbsolutePath(),
1983
			final File javaHome = getJavaHome();
1985
									null, false, null, null);
1984
			if (javaHome != null) {
1986
							if (classpath != null) {
1985
				File[] directoriesToCheck = null;
1987
								bootclasspaths.add(classpath);
1986
				if (System.getProperty("os.name").startsWith("Mac")) {//$NON-NLS-1$//$NON-NLS-2$
1987
					directoriesToCheck = new File[] {
1988
						new File(javaHome, "../Classes"), //$NON-NLS-1$
1989
					};
1990
				} else {
1991
					// fall back to try to retrieve them out of the lib directory
1992
					directoriesToCheck = new File[] {
1993
						new File(javaHome, "lib") //$NON-NLS-1$
1994
					};
1995
				}
1996
				File[][] systemLibrariesJars = getLibrariesFiles(directoriesToCheck);
1997
				if (systemLibrariesJars != null) {
1998
					for (int i = 0, max = systemLibrariesJars.length; i < max; i++) {
1999
						File[] current = systemLibrariesJars[i];
2000
						if (current != null) {
2001
							for (int j = 0, max2 = current.length; j < max2; j++) {
2002
								FileSystem.Classpath classpath =
2003
									FileSystem.getClasspath(current[j].getAbsolutePath(),
2004
										null, false, null, null);
2005
								if (classpath != null) {
2006
									bootclasspaths.add(classpath);
2007
								}
1988
							}
2008
							}
1989
						}
2009
						}
1990
					}
2010
					}
1991
				}
2011
				}
1992
			}
2012
			}
1993
 		}
2013
		}
1994
	}
2014
	}
1995
	return bootclasspaths;
2015
	return bootclasspaths;
1996
}
2016
}

Return to bug 188648