Eclipse Platform
Release 3.2

org.eclipse.core.launcher
Class Main

java.lang.Object
  extended by org.eclipse.core.launcher.Main
Direct Known Subclasses:
WebStartMain

public class Main
extends java.lang.Object

The launcher for Eclipse.


Nested Class Summary
 class Main.EndSplashHandler
           
 
Field Summary
protected  java.lang.String bootLocation
          The location of the launcher to run.
protected  java.net.URL configurationLocation
          The location of the configuration information for this instance
protected  boolean debug
          Indicates whether this instance is running in debug mode.
protected  java.lang.String devClassPath
          The extra development time class path entries.
protected static java.lang.String ENTRY
           
protected static int ERROR
           
protected  java.lang.String framework
          The id of the bundle that will contain the framework to run.
protected  boolean inDevelopmentMode
          Indicates whether this instance is running in development mode.
protected  java.net.URL installLocation
          The location of the install root
protected static java.lang.String JAR_SCHEME
           
protected  java.io.BufferedWriter log
           
protected  java.io.File logFile
           
protected static java.lang.String MESSAGE
           
protected  boolean newSession
           
protected  java.lang.String parentConfigurationLocation
          The location of the configuration information in the install root
protected static java.lang.String PLUGIN_ID
           
protected static java.lang.String PROP_FRAMEWORK
           
protected static java.lang.String REFERENCE_SCHEME
           
protected static java.lang.String SESSION
           
protected static java.lang.String STACK
           
 
Constructor Summary
Main()
           
 
Method Summary
protected  void addEntry(java.net.URL url, java.util.List result)
           
protected  void basicRun(java.lang.String[] args)
          Executes the launch.
protected  java.lang.String decode(java.lang.String urlString)
          Returns a string representation of the given URL String.
protected  int findMax(java.lang.String[] candidates)
           
protected  java.lang.String[] getArrayFromList(java.lang.String prop)
          Returns the result of converting a list of comma-separated tokens into an array
protected  java.net.URL[] getBootPath(java.lang.String base)
          Returns the URL-based class path describing where the boot classes are located.
protected  void log(java.lang.Object obj)
           
static void main(java.lang.String argString)
          Runs this launcher with the arguments specified in the given string.
static void main(java.lang.String[] args)
          Runs the platform with the given arguments.
protected  java.lang.String[] processCommandLine(java.lang.String[] args)
          Processes the command line arguments.
 int run(java.lang.String[] args)
          Runs the platform with the given arguments.
protected  java.lang.String searchFor(java.lang.String target, java.lang.String start)
          Searches for the given target directory starting in the "plugins" subdirectory of the given location.
protected  void setSecurityPolicy(java.net.URL[] bootPath)
           
protected  void takeDownSplash()
           
 
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 java.lang.String bootLocation
The location of the launcher to run.


installLocation

protected java.net.URL installLocation
The location of the install root


configurationLocation

protected java.net.URL configurationLocation
The location of the configuration information for this instance


parentConfigurationLocation

protected java.lang.String parentConfigurationLocation
The location of the configuration information in the install root


framework

protected java.lang.String framework
The id of the bundle that will contain the framework to run. Defaults to org.eclipse.osgi.


devClassPath

protected java.lang.String devClassPath
The extra development time class path entries.


inDevelopmentMode

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


REFERENCE_SCHEME

protected static final java.lang.String REFERENCE_SCHEME
See Also:
Constant Field Values

JAR_SCHEME

protected static final java.lang.String JAR_SCHEME
See Also:
Constant Field Values

PROP_FRAMEWORK

protected static final java.lang.String PROP_FRAMEWORK
See Also:
Constant Field Values

SESSION

protected static final java.lang.String SESSION
See Also:
Constant Field Values

ENTRY

protected static final java.lang.String ENTRY
See Also:
Constant Field Values

MESSAGE

protected static final java.lang.String MESSAGE
See Also:
Constant Field Values

STACK

protected static final java.lang.String STACK
See Also:
Constant Field Values

ERROR

protected static final int ERROR
See Also:
Constant Field Values

PLUGIN_ID

protected static final java.lang.String PLUGIN_ID
See Also:
Constant Field Values

logFile

protected java.io.File logFile

log

protected java.io.BufferedWriter log

newSession

protected boolean newSession
Constructor Detail

Main

public Main()
Method Detail

basicRun

protected void basicRun(java.lang.String[] args)
                 throws java.lang.Exception
Executes the launch.

Parameters:
args - command-line arguments
Throws:
java.lang.Exception - thrown if a problem occurs during the launch

setSecurityPolicy

protected void setSecurityPolicy(java.net.URL[] bootPath)

decode

protected java.lang.String decode(java.lang.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


getArrayFromList

protected java.lang.String[] getArrayFromList(java.lang.String prop)
Returns the result of converting a list of comma-separated tokens into an array

Parameters:
prop - the initial comma-separated string
Returns:
the array of string tokens

addEntry

protected void addEntry(java.net.URL url,
                        java.util.List result)

getBootPath

protected java.net.URL[] getBootPath(java.lang.String base)
                              throws java.io.IOException
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:
java.net.MalformedURLException - if a problem occurs computing the class path
java.io.IOException

searchFor

protected java.lang.String searchFor(java.lang.String target,
                                     java.lang.String start)
Searches for the given target 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
Returns:
the location where target directory was found

findMax

protected int findMax(java.lang.String[] candidates)

main

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

Parameters:
argString - the arguments string

main

public static void main(java.lang.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(String[])

run

public int run(java.lang.String[] args)
Runs the platform with the given arguments. The arguments must identify an application to run (e.g., -application com.example.application). Returns 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.

Parameters:
args - the command line arguments

processCommandLine

protected java.lang.String[] processCommandLine(java.lang.String[] args)
Processes the command line arguments. The general principle is to NOT consume the arguments and leave them to be processed by Eclipse proper. There are a few args which are directed towards main() and a few others which we need to know about. Very few should actually be consumed here.

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

takeDownSplash

protected void takeDownSplash()

log

protected void log(java.lang.Object obj)

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.