Eclipse 是如何启动的

来源:互联网 发布:起床战争服务器端口 编辑:程序博客网 时间:2024/05/17 11:05

我测试的Eclipse版本是4.2,低版本的没有测试过。

1. rt.equinox.framework/features/org.eclipse.equinox.executable.feature/library/eclipseMain.c

会编译成Linux下的eclipse可执行文件或者Windows下的eclipse.exe,它只是来完成对eclipse.ini的解析,

同时来决定通过什么方式来启动eclipse(JNI或者直接调用java来启动)。
2. eclipseMain.c通过 findSymbol方法来调用rt.equinox.framework/features/org.eclipse.equinox.executable.feature/library/eclipse.c的run方法。

在run方法中已经解析了所以的参数和知道通过那种方式来启动eclipse了,然后分两种情况:

直接通过java来启动:

javaResults = launchJavaVM(vmCommand);

通过JNI来启动(JNI_CreateJavaVM in jni.h to start JVM and run Main.run(String[]) ):
javaResults = startJavaVM(jniLib, vmCommandArgs, progCommandArgs, jarFile);


例一:如下的命令是通过eclipse可执行文件来启动eclipse的具体参数:

/usr/bin/java -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m -jar /home/test/eclipse-standard-kepler-R-linux-gtk-x86_64//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar -os linux -ws gtk -arch x86_64 -showsplash /home/test/eclipse-standard-kepler-R-linux-gtk-x86_64//plugins/org.eclipse.platform_4.3.0.v20130605-2000/splash.bmp -launcher /home/test/eclipse-standard-kepler-R-linux-gtk-x86_64/eclipse -name Eclipse--launcher.library /home/test/eclipse-standard-kepler-R-linux-gtk-x86_64//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20130521-0416/eclipse_1506.so -startup /home/test/eclipse-standard-kepler-R-linux-gtk-x86_64//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar --launcher.appendVmargs -exitdata 6fa800c -product org.eclipse.epp.package.standard.product -vm /usr/bin/java -vmargs -Dosgi.requiredJavaVersion=1.6 -XX:MaxPermSize=256m -Xms40m -Xmx512m -jar /home/test/eclipse-standard-kepler-R-linux-gtk-x86_64//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar


在Linux下的so文件是:--launcher.library /home/test/eclipse-standard-kepler-R-linux-gtk-x86_64//plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20130521-0416/eclipse_1506.so

启动文件是:-startup /home/test/eclipse-standard-kepler-R-linux-gtk-x86_64//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar

通过这种方法来启动的eclipse有两个进程,一个eclipse的可执行文件进程,另外一个是java进程

例二:直接通过java -jar来启动

java -jar /home/test/eclipse-standard-kepler-R-linux-gtk-x86_64//plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar也可以启动,

但是这种方法启动的eclipse只有java一个进程。


http://wiki.eclipse.org/Equinox_Launcher
http://wiki.eclipse.org/Equinox_Launcher_Plan

原创粉丝点击