Eclipse Platform
2.1

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
-arch <architecture>: sets the processor architecture value
-boot <location>: the location, expressed as a URL, of the platform's boot.jar. Deprecated: replaced by -configuration
-classloaderproperties [properties file]: activates platform class loader enhancements using the class loader properties file at the given location, if specified. The (optional) file argument can be either a file path or an absolute URL.
-configuration <location>: the location, expressed as a URL, for the Eclipse platform configuration file. The configuration file determines the location of the Eclipse platform, the set of available plug-ins, and the primary feature.
-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
-feature <id>: the identifier of the primary feature. The primary feature gives the launched instance of Eclipse its product personality, and determines the product customization information.
-keyring <location>: the location of the authorization database on disk. This argument has to be used together with the -password argument.
-nl <locale>: sets the name of the locale on which Eclipse platform will run
-nolazyregistrycacheloading : deactivates platform plug-in registry cache loading optimization. By default, extensions' configuration elements will be loaded from the registry cache (when available) only on demand, reducing memory footprint. This option will force the registry cache to be fully loaded at startup.
-nopackageprefixes: deactivates classloader package prefixes optimization
-noregistrycache: bypasses the reading and writing of an internal plug-in registry cache file
-os <operating system>: sets the operating system value
-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). Deprecated: replaced by -configuration
-plugincustomization <properties file>: the location of a properties file containing default settings for plug-in preferences. These default settings override default settings specified in the primary feature. Relative paths are interpreted relative to the directory that eclipse was started from.
-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 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

ENTRY

protected static final String ENTRY

MESSAGE

protected static final String MESSAGE

STACK

protected static final String STACK

ERROR

protected static final int ERROR

PLUGIN_ID

protected static final String PLUGIN_ID

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

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

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

Eclipse Platform
2.1

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