KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > launching > support > LibraryDetector


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.launching.support;
12
13
14 /**
15  * Used to discover the boot path, extension directories, and endorsed
16  * directories for a Java VM.
17  */

18 public class LibraryDetector {
19
20     /**
21      * Prints system properties to standard out.
22      * <ul>
23      * <li>java.version</li>
24      * <li>sun.boot.class.path</li>
25      * <li>java.ext.dirs</li>
26      * <li>java.endorsed.dirs</li>
27      * </ul>
28      *
29      * @param args
30      */

31     public static void main(String JavaDoc[] args) {
32         // if we are running raw j9
33
if ("j9".equalsIgnoreCase(System.getProperty("java.vm.name"))) { //$NON-NLS-1$ //$NON-NLS-2$
34
// Map class lib versions onto things that the launch infrastructure understands. J9
35
// behaves like 1.4 wrt launch/debug
36
String JavaDoc configuration = System.getProperty("com.ibm.oti.configuration"); //$NON-NLS-1$
37
if ("found10".equals(configuration)) //$NON-NLS-1$
38
System.out.print("1.4"); //$NON-NLS-1$
39
else if ("found11".equals(configuration)) //$NON-NLS-1$
40
System.out.print("1.4"); //$NON-NLS-1$
41
else
42                 System.out.print(System.getProperty("java.version")); //$NON-NLS-1$
43
System.out.print("|"); //$NON-NLS-1$
44
System.out.print(System.getProperty("com.ibm.oti.system.class.path")); //$NON-NLS-1$
45
} else {
46             System.out.print(System.getProperty("java.version")); //$NON-NLS-1$
47
System.out.print("|"); //$NON-NLS-1$
48
System.out.print(System.getProperty("sun.boot.class.path")); //$NON-NLS-1$
49
}
50         System.out.print("|"); //$NON-NLS-1$
51
System.out.print(System.getProperty("java.ext.dirs")); //$NON-NLS-1$
52
System.out.print("|"); //$NON-NLS-1$
53
System.out.print(System.getProperty("java.endorsed.dirs")); //$NON-NLS-1$
54
}
55 }
56
Popular Tags