Eclipse Platform
2.0

org.eclipse.core.launcher
Class Main

java.lang.Object
  |
  +--org.eclipse.core.launcher.Main

public class Main
extends Object

Startup class for Eclipse. Creates a class loader using supplied URL of platform installation, loads and calls the Eclipse Boot Loader. The startup arguments are as follows:

-application <id>: the identifier of the application to run
-boot <location>: the location, expressed as a URL, of the platform's boot.jar
-consolelog : enables log to the console. Handy when combined with -debug
-data <location>: sets the workspace location and the default location for projects
-debug [options file]: turns on debug mode for the platform and optionally specifies a location for the .options file. This file indicates what debug points are available for a plug-in and whether or not they are enabled. If a location is not specified, the platform searches for the .options file under the install directory
-dev [entries]: turns on dev mode and optionally specifies comma-separated class path entries which are added to the class path of each plug-in
-keyring <location>: the location of the authorization database on disk. This argument has to be used together with the -password argument
-password <passwd>: the password for the authorization database
-plugins <location>: The arg is a URL pointing to a file which specs the plugin path for the platform. The file is in property file format where the keys are user-defined names and the values are comma separated lists of either explicit paths to plugin.xml files or directories containing plugins. (e.g., .../eclipse/plugins).
-ws <window system>: sets the window system value


Field Summary
protected  String application
          The identifier of the application to run.
protected static String[] arguments
           
protected  String bootLocation
          The location of the launcher to run.
protected  String configuration
          The identifier of the configuration to use.
protected  boolean debug
          Indicates whether this instance is running in debug mode.
protected  String devClassPath
          The class path entries.
protected static String ENTRY
           
protected static int ERROR
           
protected  String feature
          The identifier of the feature to run.
protected  boolean inDevelopmentMode
          Indicates whether this instance is running in development mode.
protected  String location
          The boot path location.
protected static BufferedWriter log
           
protected static File logFile
           
protected static String logFileName
           
protected static String MESSAGE
           
protected static boolean newSession
           
protected static String PLUGIN_ID
           
protected  URL pluginPathLocation
          The path for finding find plugins.
protected  String rootLocation
          The location of the install root
protected static String SESSION
           
protected static String STACK
           
 
Constructor Summary
Main()
           
 
Method Summary
protected  Object basicRun(String[] args)
          Executes the launch.
protected  String decode(String urlString)
          Returns a string representation of the given URL String.
 Class getBootLoader(URL[] path)
          Creates and returns a platform BootLoader which can be used to start up and run the platform.
protected  URL[] getBootPath(String base)
          Returns the URL-based class path describing where the boot classes are located.
protected  URL[] getDevPath(URL base)
          Returns the URL-based class path describing where the boot classes are located when running in development mode.
static void main(String argString)
          Runs this launcher with the arguments specified in the given string.
static void main(String[] args)
          Runs the platform with the given arguments.
protected  String[] processCommandLine(String[] args)
          Processes the command line arguments
 Object run(String[] args)
          Runs the application to be launched.
protected  String searchForBoot(String start)
          Searches for a boot directory starting in the "plugins" subdirectory of the given location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected boolean debug
Indicates whether this instance is running in debug mode.


bootLocation

protected String bootLocation
The location of the launcher to run.


rootLocation

protected String rootLocation
The location of the install root


application

protected String application
The identifier of the application to run.


feature

protected String feature
The identifier of the feature to run.


configuration

protected String configuration
The identifier of the configuration to use.


pluginPathLocation

protected URL pluginPathLocation
The path for finding find plugins.


location

protected String location
The boot path location.


devClassPath

protected String devClassPath
The class path entries.


inDevelopmentMode

protected boolean inDevelopmentMode
Indicates whether this instance is running in development mode.


SESSION

protected static final String SESSION
See Also:
Constant Field Values

ENTRY

protected static final String ENTRY
See Also:
Constant Field Values

MESSAGE

protected static final String MESSAGE
See Also:
Constant Field Values

STACK

protected static final String STACK
See Also:
Constant Field Values

ERROR

protected static final int ERROR
See Also:
Constant Field Values

PLUGIN_ID

protected static final String PLUGIN_ID
See Also:
Constant Field Values

logFileName

protected static final String logFileName

logFile

protected static File logFile

log

protected static BufferedWriter log

arguments

protected static String[] arguments

newSession

protected static boolean newSession
Constructor Detail

Main

public Main()
Method Detail

basicRun

protected Object basicRun(String[] args)
                   throws Exception
Executes the launch.

Parameters:
args - command-line arguments
Returns:
the result of performing the launch
Throws:
Exception - thrown if a problem occurs during the launch

decode

protected String decode(String urlString)
Returns a string representation of the given URL String. This converts escaped sequences (%..) in the URL into the appropriate characters. NOTE: due to class visibility there is a copy of this method in InternalBootLoader


getBootLoader

public Class getBootLoader(URL[] path)
                    throws Exception
Creates and returns a platform BootLoader which can be used to start up and run the platform.

Parameters:
path - search path for the BootLoader
Returns:
the new boot loader
Exception

getDevPath

protected URL[] getDevPath(URL base)
                    throws MalformedURLException
Returns the URL-based class path describing where the boot classes are located when running in development mode.

Parameters:
base - the base location
Returns:
the url-based class path
Throws:
MalformedURLException - if a problem occurs computing the class path

getBootPath

protected URL[] getBootPath(String base)
                     throws MalformedURLException
Returns the URL-based class path describing where the boot classes are located.

Parameters:
base - the base location
Returns:
the url-based class path
Throws:
MalformedURLException - if a problem occurs computing the class path

searchForBoot

protected String searchForBoot(String start)
Searches for a boot directory starting in the "plugins" subdirectory of the given location. If one is found then this location is returned; otherwise an exception is thrown.

Parameters:
start - the location to begin searching at
Returns:
the location where boot directory was found

main

public static void main(String[] args)
Runs the platform with the given arguments. The arguments must identify an application to run (e.g., -application com.example.application). After running the application System.exit(N) is executed. The value of N is derived from the value returned from running the application. If the application's return value is an Integer, N is this value. In all other cases, N = 0.

Clients wishing to run the platform without a following System.exit call should use run().

Parameters:
args - the command line arguments
See Also:
run(java.lang.String[])

main

public static void main(String argString)
                 throws Exception
Runs this launcher with the arguments specified in the given string.

Parameters:
argString - the arguments string
Throws:
Exception - thrown if a problem occurs during launching

processCommandLine

protected String[] processCommandLine(String[] args)
                               throws Exception
Processes the command line arguments

Parameters:
args - the command line arguments
Returns:
the arguments to pass through to the launched application
Exception

run

public Object run(String[] args)
           throws Exception
Runs the application to be launched.

Parameters:
args - the arguments to pass to the application
Returns:
the return value from the launched application
Throws:
thrown - if a problem occurs during launching
Exception

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.