Eclipse Product 的启动过程
2014-03-04 22:31
211 查看
参考自:http://niub.iteye.com/blog/1807588
双击eclipse安装目录下的 eclipse.exe ,会加载同一目录下的 eclipse.ini 文件。示例:
<一> Eclipse 的JVM 启动时,找JRE 的顺序。
如果eclipse.ini中配置了-vm参数,那么则使用这个参数指定的JRE(jvm.dll库路径);
否则,查看eclipse安装目录下是否有JRE文件夹,如果有的话就使用这个JRE;
否则,去系统注册表中查找安装的JRE,如果还找不到就报错。
<二>eclipse.ini
-startup 指定启动的入口为:安装目录下plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
会加载该jar包中的org.eclipse.equinox.launcher.Main.class类并调用其main(String)完成app的启动过程。
1.processConfiguration():处理配置信息
,通过 config.ini 文件。
2.getInstallLocation():
获取当前安装路径。
3.getBootPath():获取启动路径列表
。
4.setupJNI():启动JNIBridge,加载dll类库
。
5.invokeFramework():启动Equinox框架
。
双击eclipse安装目录下的 eclipse.exe ,会加载同一目录下的 eclipse.ini 文件。示例:
-startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502 -product org.eclipse.epp.package.rcp.product --launcher.defaultAction openFile -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256M -vmargs -Dosgi.requiredJavaVersion=1.5 -Xms40m -Xmx512m
<一> Eclipse 的JVM 启动时,找JRE 的顺序。
如果eclipse.ini中配置了-vm参数,那么则使用这个参数指定的JRE(jvm.dll库路径);
否则,查看eclipse安装目录下是否有JRE文件夹,如果有的话就使用这个JRE;
否则,去系统注册表中查找安装的JRE,如果还找不到就报错。
<二>eclipse.ini
-startup 指定启动的入口为:安装目录下plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
会加载该jar包中的org.eclipse.equinox.launcher.Main.class类并调用其main(String)完成app的启动过程。
public static void main(String[] args) { int result = 0; ... result = new Main().run(args); ... }run() 方法会调用 basicRun() 方法。basicRun() 方法如下:
protected void basicRun(String[] args) throws Exception { //记录启动启动时间 System.getProperties().put("eclipse.startTime", Long.toString(System.currentTimeMillis())); //$NON-NLS-1$ commands = args; //处理Command参数,并根据Command参数设置默认属性 String[] passThruArgs = processCommandLine(args); if (!debug) // debug can be specified as system property as well debug = System.getProperty(PROP_DEBUG) != null; setupVMProperties();//将VM参数写入到System.Properties中 processConfiguration();//加载配置信息 getInstallLocation();//获取安装路径,这里调用一下是为了确保InstallLocation被初始化 // locate boot plugin (may return -dev mode variations) URL[] bootPath = getBootPath(bootLocation);//获取启动路径列表 setupJNI(bootPath);//启动JNIBridge,加载dll类库 //检查JDK版本 if (!checkVersion(System.getProperty("java.version"), System.getProperty(PROP_REQUIRED_JAVA_VERSION))) return; //检查配置信息 if (!checkConfigurationLocation(configurationLocation)) return; setSecurityPolicy(bootPath);//设置安全策略 handleSplash(bootPath);//启动闪屏,就是Eclipse(或RCP启动时IDE打开前带有进度条的界面) beforeFwkInvocation(); invokeFramework(passThruArgs, bootPath);//加载框架(前面的工作都是辅助,这个才是加载框架的核心) }<三> 各个方法简要说明,
1.processConfiguration():处理配置信息
,通过 config.ini 文件。
2.getInstallLocation():
获取当前安装路径。
3.getBootPath():获取启动路径列表
。
4.setupJNI():启动JNIBridge,加载dll类库
。
5.invokeFramework():启动Equinox框架
。
相关文章推荐
- eclipse启动错误:version 1.4 of the JVM is not suitable for this product. Version 1.5 or grea 。。。
- linux启动tomcat过程,像eclipse一样在控制台输出
- Eclipse启动过程
- Eclipse基础--Eclipse启动过程
- JVM学习:使用visualGC调优Eclipse启动过程
- Eclipse基础--Eclipse启动过程http://writeblog.csdn.net/EditGalleries.aspx
- Eclipse启动优化,分析其GC过程【转】
- 启动eclipse报Version 1.6.0_65 of the JVM is not suitable for this product.
- eclipse启动或者运行过程中tomcat出现内存溢出错误 java.lang.OutOfMemoryError: PermGen space
- Eclipse启动过程
- Tomcat端口号修改后在eclipse启动服务过程中自动改回
- 记一次eclipse无法启动的排查过程
- (Eclipse on linux 启动过程中报错)java.lang.RuntimeException: Widget disposed too early!
- Eclipse基础--Eclipse启动过程
- Eclipse启动过程
- eclipse启动过程怎么查找JRE
- Eclipse基础--Eclipse启动过程
- linux启动tomcat过程,像eclipse一样在控制台输出
- Eclipse基础--Eclipse启动过程