public class Main extends Object
Copied straight from Eclipse Mars.2.
The launcher for Eclipse.
Note: This class should not be referenced programmatically by other Java code. This class exists only for the purpose of launching Eclipse from the command line. To launch Eclipse programmatically, use org.eclipse.core.runtime.adaptor.EclipseStarter. The fields and methods on this class are not API.
Modifier and Type | Class and Description |
---|---|
class |
Main.SplashHandler |
Modifier and Type | Field and Description |
---|---|
protected String |
arch |
protected String |
bootLocation
The location of the launcher to run.
|
protected URL |
configurationLocation
The location of the configuration information for this instance
|
protected boolean |
debug
Indicates whether this instance is running in debug mode.
|
protected String |
devClassPath
The extra development time class path entries for the framework.
|
protected static String |
ENTRY |
protected static int |
ERROR |
protected 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 URL |
installLocation
The location of the install root
|
protected static String |
JAR_SCHEME |
protected BufferedWriter |
log |
protected File |
logFile |
protected static String |
MESSAGE |
protected boolean |
newSession |
protected String |
os
Indicates which OS was passed in with -os
|
protected String |
parentConfigurationLocation
The location of the configuration information in the install root
|
protected static String |
PLUGIN_ID |
protected static String |
PROP_FRAMEWORK |
protected static String |
REFERENCE_SCHEME |
protected static String |
SESSION |
static String |
SPLASH_HANDLE |
static String |
SPLASH_LOCATION |
protected boolean |
splashDown |
protected Thread |
splashHandler |
protected static String |
STACK |
static char |
VARIABLE_DELIM_CHAR |
static String |
VARIABLE_DELIM_STRING |
protected String |
ws |
Constructor and Description |
---|
Main() |
Modifier and Type | Method and Description |
---|---|
protected void |
addEntry(URL url,
List result) |
void |
basicRun(String[] args)
Executes the launch.
|
protected void |
beforeFwkInvocation() |
protected String |
decode(String urlString)
Returns a string representation of the given URL String.
|
protected int |
findMax(String prefix,
String[] candidates) |
protected String[] |
getArrayFromList(String prop)
Returns the result of converting a list of comma-separated tokens into an array
|
protected URL[] |
getBootPath(String base)
Returns the
URL -based class path describing where the boot classes are located. |
protected String |
getDate(Date date) |
protected void |
invokeFramework(String[] passThruArgs,
URL[] bootPath) |
protected void |
log(Object obj) |
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.
|
int |
run(String[] args)
Runs the platform with the given arguments.
|
protected String |
searchFor(String target,
String start)
Searches for the given target directory starting in the “plugins” subdirectory of the given location.
|
protected String |
searchFor(String target,
String targetSuffix,
String start) |
protected void |
setSecurityPolicy(URL[] bootPath) |
static String |
substituteVars(String path) |
protected void |
takeDownSplash() |
protected boolean debug
Indicates whether this instance is running in debug mode.
protected String bootLocation
The location of the launcher to run.
protected URL installLocation
The location of the install root
protected URL configurationLocation
The location of the configuration information for this instance
protected String parentConfigurationLocation
The location of the configuration information in the install root
protected String framework
The id of the bundle that will contain the framework to run. Defaults to org.eclipse.osgi.
protected String devClassPath
The extra development time class path entries for the framework.
protected boolean inDevelopmentMode
Indicates whether this instance is running in development mode.
protected String os
Indicates which OS was passed in with -os
protected String ws
protected String arch
protected boolean splashDown
protected final Thread splashHandler
public static final String SPLASH_HANDLE
public static final String SPLASH_LOCATION
protected static final String REFERENCE_SCHEME
protected static final String JAR_SCHEME
protected static final String PROP_FRAMEWORK
protected static final String SESSION
protected static final String ENTRY
protected static final String MESSAGE
protected static final String STACK
protected static final int ERROR
protected static final String PLUGIN_ID
protected File logFile
protected BufferedWriter log
protected boolean newSession
public static final String VARIABLE_DELIM_STRING
public static final char VARIABLE_DELIM_CHAR
public void basicRun(String[] args) throws Exception
Executes the launch.
args
- command-line argumentsException
- thrown if a problem occurs during the launchprotected void beforeFwkInvocation()
protected void setSecurityPolicy(URL[] bootPath)
protected void invokeFramework(String[] passThruArgs, URL[] bootPath) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, Error, Exception, InvocationTargetException
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
protected String[] getArrayFromList(String prop)
Returns the result of converting a list of comma-separated tokens into an array
prop
- the initial comma-separated stringprotected URL[] getBootPath(String base) throws IOException
Returns the URL
-based class path describing where the boot classes are located.
base
- the base locationMalformedURLException
- if a problem occurs computing the class pathIOException
protected String searchFor(String target, 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.
start
- the location to begin searchingpublic static void main(String argString)
Runs this launcher with the arguments specified in the given string.
argString
- the arguments stringpublic 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()
.
args
- the command line argumentsrun(String[])
public int run(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.
args
- the command line argumentsprotected String[] processCommandLine(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.
args
- the command line argumentsprotected void takeDownSplash()
protected void log(Object obj)