Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.eclipse.core.launcher
Class Main  view Main download Main.java

java.lang.Object
  extended byorg.eclipse.core.launcher.Main

public class Main
extends java.lang.Object

The launcher for Eclipse.


Nested Class Summary
private  class Main.StartupClassLoader
           
 
Field Summary
protected  java.lang.String bootLocation
          The location of the launcher to run.
private  java.lang.String[] commands
           
private static java.lang.String CONFIG_DIR
           
private static java.lang.String CONFIG_FILE
           
private static java.lang.String CONFIG_FILE_BAK_SUFFIX
           
private static java.lang.String CONFIG_FILE_TEMP_SUFFIX
           
private static java.lang.String CONFIGURATION
           
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.
private static java.lang.String DEBUG
           
private static java.lang.String DEV
           
protected  java.lang.String devClassPath
          The extra development time class path entries.
private static java.lang.String ECLIPSE
           
private static java.lang.String ECLIPSE_PROPERTIES
           
private  java.lang.String endSplash
           
private static java.lang.String ENDSPLASH
           
private  java.lang.Runnable endSplashHandler
           
protected static java.lang.String ENTRY
           
protected static int ERROR
           
private  java.lang.String exitData
           
private static java.lang.String EXITDATA
           
private  java.lang.String[] extensionPaths
           
private static java.lang.String FILE_SCHEME
           
protected  java.lang.String framework
          The id of the bundle that will contain the framework to run.
private static java.lang.String FRAMEWORK
           
protected  boolean inDevelopmentMode
          Indicates whether this instance is running in development mode.
private  boolean initialize
           
private static java.lang.String INITIALIZE
           
private static java.lang.String INSTALL
           
protected  java.net.URL installLocation
          The location of the install root
protected  java.io.BufferedWriter log
           
protected  java.io.File logFile
           
protected static java.lang.String MESSAGE
           
protected  boolean newSession
           
private static java.lang.String NO_DEFAULT
           
private static java.lang.String NONE
           
private static java.lang.String NOSPLASH
           
private static java.lang.String OSGI
           
protected  java.lang.String parentConfigurationLocation
          The location of the configuration information in the install root
private static java.lang.String PLATFORM_URL
           
protected static java.lang.String PLUGIN_ID
           
private static java.lang.String PRODUCT_SITE_ID
           
private static java.lang.String PRODUCT_SITE_MARKER
           
private static java.lang.String PRODUCT_SITE_VERSION
           
private static java.lang.String PROP_BASE_CONFIG_AREA
           
private static java.lang.String PROP_CLASSPATH
           
private static java.lang.String PROP_COMMANDS
           
private static java.lang.String PROP_CONFIG_AREA
           
private static java.lang.String PROP_CONFIG_AREA_DEFAULT
           
private static java.lang.String PROP_CONFIG_CASCADED
           
private static java.lang.String PROP_EOF
           
private static java.lang.String PROP_EXITCODE
           
private static java.lang.String PROP_EXITDATA
           
private static java.lang.String PROP_EXTENSIONS
           
private static java.lang.String PROP_FRAMEWORK
           
private static java.lang.String PROP_INSTALL_AREA
           
private static java.lang.String PROP_LOGFILE
           
private static java.lang.String PROP_SHARED_CONFIG_AREA
           
private static java.lang.String PROP_SPLASHLOCATION
           
private static java.lang.String PROP_SPLASHPATH
           
private static java.lang.String PROP_USER_DIR
           
private static java.lang.String PROP_USER_HOME
           
private static java.lang.String PROP_VM
           
private static java.lang.String PROP_VMARGS
           
protected static java.lang.String SESSION
           
private  java.lang.Process showProcess
           
private  java.lang.String showSplash
           
private static java.lang.String SHOWSPLASH
           
private static java.lang.String SPLASH_IMAGE
           
private  boolean splashDown
           
protected static java.lang.String STACK
           
private static java.lang.String STARTER
           
private static java.lang.String USER_DIR
           
private static java.lang.String USER_HOME
           
private  java.lang.String vm
           
private static java.lang.String VM
           
private  java.lang.String[] vmargs
           
private static java.lang.String VMARGS
           
 
Constructor Summary
Main()
           
 
Method Summary
private  void addBaseJars(java.net.URL base, java.util.ArrayList result)
           
private  void addDevEntries(java.net.URL base, java.util.List result)
           
private  void addEntry(java.net.URL url, java.util.List result)
           
private static java.net.URL adjustTrailingSlash(java.net.URL url, boolean trailingSlash)
           
protected  java.lang.Object basicRun(java.lang.String[] args)
          Executes the launch.
private  java.net.URL buildLocation(java.lang.String property, java.net.URL defaultLocation, java.lang.String userDefaultAppendage)
           
private static java.net.URL buildURL(java.lang.String spec, boolean trailingSlash)
           
private static boolean canWrite(java.io.File installDir)
           
private  void closeLogFile()
           
private  int compareVersion(java.lang.Object[] left, java.lang.Object[] right)
          Compares version strings.
private  java.lang.String computeDefaultConfigurationLocation()
          Retuns the default file system path for the configuration location.
private  java.lang.String computeDefaultUserAreaLocation(java.lang.String pathAppendage)
          Returns a files system path for an area in the user.home region related to the current product.
private  void computeLogFileLocation()
           
private  java.lang.String decode(java.lang.String urlString)
          Returns a string representation of the given URL String.
private  java.lang.String[] getArrayFromList(java.lang.String prop)
          Returns the result of converting a list of comma-separated tokens into an array
private  java.net.URL[] getBootPath(java.lang.String base)
          Returns the URL-based class path describing where the boot classes are located.
private  java.net.URL getConfigurationLocation()
           
private  java.net.URL[] getDevPath(java.net.URL base)
          Returns the URL-based class path describing where the boot classes are located when running in development mode.
private  java.net.URL getInstallLocation()
          Returns url of the location this class was loaded from
private  java.lang.String getSplashLocation(java.net.URL[] bootPath)
           
private  java.lang.Object[] getVersionElements(java.lang.String version)
          Do a quick parse of version identifier so its elements can be correctly compared.
private  void handleSplash(java.net.URL[] defaultPath)
           
private  int hexToByte(byte b)
          Converts an ASCII character representing a hexadecimal value into its integer equivalent.
private  java.util.Properties load(java.net.URL url, java.lang.String suffix)
           
private  java.util.Properties loadConfiguration(java.net.URL url)
           
private  java.util.Properties loadProperties(java.net.URL url)
           
private  void log(java.lang.Object obj)
           
private  java.io.BufferedWriter logForStream(java.io.OutputStream output)
           
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.
private  void mergeProperties(java.util.Properties destination, java.util.Properties source)
           
private  void openLogFile()
           
protected  java.lang.String[] processCommandLine(java.lang.String[] args)
          Processes the command line arguments.
private  void processConfiguration()
           
private  java.lang.String processDevArg(java.lang.String arg)
           
private  void readFrameworkExtensions(java.net.URL base, java.util.ArrayList result)
           
private  java.lang.String resolve(java.lang.String urlString)
           
 int run(java.lang.String[] args)
          Runs the platform with the given arguments.
private  java.lang.Process runCommand(boolean block, java.lang.String command, java.lang.String data, java.lang.String separator)
           
private  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.
private  java.lang.String searchForSplash(java.lang.String[] searchPath)
           
private  void setExitData()
           
private  void setMultiValueProperty(java.lang.String property, java.lang.String[] value)
           
private  void setupVMProperties()
           
private  java.lang.String substituteVar(java.lang.String source, java.lang.String var, java.lang.String prop)
           
protected  void takeDownSplash()
           
private  void write(java.lang.Object obj)
           
 
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.


exitData

private java.lang.String exitData

vm

private java.lang.String vm

vmargs

private java.lang.String[] vmargs

commands

private java.lang.String[] commands

extensionPaths

private java.lang.String[] extensionPaths

showSplash

private java.lang.String showSplash

endSplash

private java.lang.String endSplash

initialize

private boolean initialize

showProcess

private java.lang.Process showProcess

splashDown

private boolean splashDown

endSplashHandler

private final java.lang.Runnable endSplashHandler

FRAMEWORK

private static final java.lang.String FRAMEWORK
See Also:
Constant Field Values

INSTALL

private static final java.lang.String INSTALL
See Also:
Constant Field Values

INITIALIZE

private static final java.lang.String INITIALIZE
See Also:
Constant Field Values

VM

private static final java.lang.String VM
See Also:
Constant Field Values

VMARGS

private static final java.lang.String VMARGS
See Also:
Constant Field Values

DEBUG

private static final java.lang.String DEBUG
See Also:
Constant Field Values

DEV

private static final java.lang.String DEV
See Also:
Constant Field Values

CONFIGURATION

private static final java.lang.String CONFIGURATION
See Also:
Constant Field Values

EXITDATA

private static final java.lang.String EXITDATA
See Also:
Constant Field Values

NOSPLASH

private static final java.lang.String NOSPLASH
See Also:
Constant Field Values

SHOWSPLASH

private static final java.lang.String SHOWSPLASH
See Also:
Constant Field Values

ENDSPLASH

private static final java.lang.String ENDSPLASH
See Also:
Constant Field Values

SPLASH_IMAGE

private static final java.lang.String SPLASH_IMAGE
See Also:
Constant Field Values

OSGI

private static final java.lang.String OSGI
See Also:
Constant Field Values

STARTER

private static final java.lang.String STARTER
See Also:
Constant Field Values

PLATFORM_URL

private static final java.lang.String PLATFORM_URL
See Also:
Constant Field Values

ECLIPSE_PROPERTIES

private static final java.lang.String ECLIPSE_PROPERTIES
See Also:
Constant Field Values

FILE_SCHEME

private static final java.lang.String FILE_SCHEME
See Also:
Constant Field Values

CONFIG_DIR

private static final java.lang.String CONFIG_DIR
See Also:
Constant Field Values

CONFIG_FILE

private static final java.lang.String CONFIG_FILE
See Also:
Constant Field Values

CONFIG_FILE_TEMP_SUFFIX

private static final java.lang.String CONFIG_FILE_TEMP_SUFFIX
See Also:
Constant Field Values

CONFIG_FILE_BAK_SUFFIX

private static final java.lang.String CONFIG_FILE_BAK_SUFFIX
See Also:
Constant Field Values

ECLIPSE

private static final java.lang.String ECLIPSE
See Also:
Constant Field Values

PRODUCT_SITE_MARKER

private static final java.lang.String PRODUCT_SITE_MARKER
See Also:
Constant Field Values

PRODUCT_SITE_ID

private static final java.lang.String PRODUCT_SITE_ID
See Also:
Constant Field Values

PRODUCT_SITE_VERSION

private static final java.lang.String PRODUCT_SITE_VERSION
See Also:
Constant Field Values

PROP_USER_HOME

private static final java.lang.String PROP_USER_HOME
See Also:
Constant Field Values

PROP_USER_DIR

private static final java.lang.String PROP_USER_DIR
See Also:
Constant Field Values

PROP_INSTALL_AREA

private static final java.lang.String PROP_INSTALL_AREA
See Also:
Constant Field Values

PROP_CONFIG_AREA

private static final java.lang.String PROP_CONFIG_AREA
See Also:
Constant Field Values

PROP_CONFIG_AREA_DEFAULT

private static final java.lang.String PROP_CONFIG_AREA_DEFAULT
See Also:
Constant Field Values

PROP_BASE_CONFIG_AREA

private static final java.lang.String PROP_BASE_CONFIG_AREA
See Also:
Constant Field Values

PROP_SHARED_CONFIG_AREA

private static final java.lang.String PROP_SHARED_CONFIG_AREA
See Also:
Constant Field Values

PROP_CONFIG_CASCADED

private static final java.lang.String PROP_CONFIG_CASCADED
See Also:
Constant Field Values

PROP_FRAMEWORK

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

PROP_SPLASHPATH

private static final java.lang.String PROP_SPLASHPATH
See Also:
Constant Field Values

PROP_SPLASHLOCATION

private static final java.lang.String PROP_SPLASHLOCATION
See Also:
Constant Field Values

PROP_CLASSPATH

private static final java.lang.String PROP_CLASSPATH
See Also:
Constant Field Values

PROP_EXTENSIONS

private static final java.lang.String PROP_EXTENSIONS
See Also:
Constant Field Values

PROP_LOGFILE

private static final java.lang.String PROP_LOGFILE
See Also:
Constant Field Values

PROP_EOF

private static final java.lang.String PROP_EOF
See Also:
Constant Field Values

PROP_EXITCODE

private static final java.lang.String PROP_EXITCODE
See Also:
Constant Field Values

PROP_EXITDATA

private static final java.lang.String PROP_EXITDATA
See Also:
Constant Field Values

PROP_VM

private static final java.lang.String PROP_VM
See Also:
Constant Field Values

PROP_VMARGS

private static final java.lang.String PROP_VMARGS
See Also:
Constant Field Values

PROP_COMMANDS

private static final java.lang.String PROP_COMMANDS
See Also:
Constant Field Values

NONE

private static final java.lang.String NONE
See Also:
Constant Field Values

NO_DEFAULT

private static final java.lang.String NO_DEFAULT
See Also:
Constant Field Values

USER_HOME

private static final java.lang.String USER_HOME
See Also:
Constant Field Values

USER_DIR

private static final java.lang.String USER_DIR
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 java.lang.Object basicRun(java.lang.String[] args)
                             throws java.lang.Exception
Executes the launch.


decode

private 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

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


getDevPath

private java.net.URL[] getDevPath(java.net.URL base)
                           throws java.io.IOException
Returns the URL-based class path describing where the boot classes are located when running in development mode.


readFrameworkExtensions

private void readFrameworkExtensions(java.net.URL base,
                                     java.util.ArrayList result)
                              throws java.io.IOException

addBaseJars

private void addBaseJars(java.net.URL base,
                         java.util.ArrayList result)
                  throws java.io.IOException

addEntry

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

addDevEntries

private void addDevEntries(java.net.URL base,
                           java.util.List result)
                    throws java.net.MalformedURLException

getBootPath

private 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.


searchFor

private 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.


compareVersion

private int compareVersion(java.lang.Object[] left,
                           java.lang.Object[] right)
Compares version strings.


getVersionElements

private java.lang.Object[] getVersionElements(java.lang.String version)
Do a quick parse of version identifier so its elements can be correctly compared. If we are unable to parse the full version, remaining elements are initialized with suitable defaults.


buildURL

private static java.net.URL buildURL(java.lang.String spec,
                                     boolean trailingSlash)

adjustTrailingSlash

private static java.net.URL adjustTrailingSlash(java.net.URL url,
                                                boolean trailingSlash)
                                         throws java.net.MalformedURLException

buildLocation

private java.net.URL buildLocation(java.lang.String property,
                                   java.net.URL defaultLocation,
                                   java.lang.String userDefaultAppendage)

substituteVar

private java.lang.String substituteVar(java.lang.String source,
                                       java.lang.String var,
                                       java.lang.String prop)

computeDefaultConfigurationLocation

private java.lang.String computeDefaultConfigurationLocation()
Retuns the default file system path for the configuration location. By default the configuration information is in the installation directory if this is writeable. Otherwise it is located somewhere in the user.home area relative to the current product.


canWrite

private static boolean canWrite(java.io.File installDir)

computeDefaultUserAreaLocation

private java.lang.String computeDefaultUserAreaLocation(java.lang.String pathAppendage)
Returns a files system path for an area in the user.home region related to the current product. The given appendage is added to this base location


main

public static void main(java.lang.String argString)
Runs this launcher with the arguments specified in the given 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().


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.


setExitData

private void setExitData()

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.


processDevArg

private java.lang.String processDevArg(java.lang.String arg)

getConfigurationLocation

private java.net.URL getConfigurationLocation()

processConfiguration

private void processConfiguration()

getInstallLocation

private java.net.URL getInstallLocation()
Returns url of the location this class was loaded from


loadConfiguration

private java.util.Properties loadConfiguration(java.net.URL url)

loadProperties

private java.util.Properties loadProperties(java.net.URL url)
                                     throws java.io.IOException

load

private java.util.Properties load(java.net.URL url,
                                  java.lang.String suffix)
                           throws java.io.IOException

handleSplash

private void handleSplash(java.net.URL[] defaultPath)

runCommand

private java.lang.Process runCommand(boolean block,
                                     java.lang.String command,
                                     java.lang.String data,
                                     java.lang.String separator)

takeDownSplash

protected void takeDownSplash()

getSplashLocation

private java.lang.String getSplashLocation(java.net.URL[] bootPath)

searchForSplash

private java.lang.String searchForSplash(java.lang.String[] searchPath)

resolve

private java.lang.String resolve(java.lang.String urlString)

log

private void log(java.lang.Object obj)

write

private void write(java.lang.Object obj)
            throws java.io.IOException

computeLogFileLocation

private void computeLogFileLocation()

hexToByte

private int hexToByte(byte b)
Converts an ASCII character representing a hexadecimal value into its integer equivalent.


openLogFile

private void openLogFile()
                  throws java.io.IOException

logForStream

private java.io.BufferedWriter logForStream(java.io.OutputStream output)

closeLogFile

private void closeLogFile()
                   throws java.io.IOException

mergeProperties

private void mergeProperties(java.util.Properties destination,
                             java.util.Properties source)

setupVMProperties

private void setupVMProperties()

setMultiValueProperty

private void setMultiValueProperty(java.lang.String property,
                                   java.lang.String[] value)