获取Eclipse执行文件根目录

Eclipse插件获取Eclipse的根目录

String eclipseRoot = Platform.getInstallLocation().getURL().toString();
eclipseRoot = eclipseRoot.replace("file:/", "");

Eclipse插件获取Workspace根目录

//方法1
String workspaceRoot= Platform.getInstanceLocation().getURL().toString();
workspaceRoot = workspaceRoot.replace("file:/", "");

//方法2
String path = Activator.getDefault().getStateLocation().makeAbsolute().toFile().getAbsolutePath();

Eclipse插件获取User根目录

String userHome = Platform.getUserLocation().getURL().toString();
userHome = userHome.replace("file:/", "");

Elclipse插件获取Bundle的OSGI路径

//方法1
String bundlePath = Activator.getDefault().getBundle().getLocation();
String pathBundle = bundlePath.replace("reference:file:/","");

//方法2
Bundle bundle = Platform.getBundle("bundle id");
URL urlentry = bundle.getEntry("bundle resource path");
String strEntry = FileLocator.toFileURL(urlentry).getPath();

//方法3
String pathClass = KeyHandler.class.getResource("resource path").getFile();	

Eclipse开发插件

ADT:
https://dl-ssl.google.com/android/eclipse/

DLTK:
http://download.eclipse.org/technology/dltk/updates/

PyDev:
http://pydev.org/updates

EPIC:
http://e-p-i-c.sf.net/updates

PDT:
http://download.eclipse.org/tools/pdt/updates/2.0
http://download.eclipse.org/tools/pdt/updates/3.0/milestones/

指定JDK

eclipse.exe -vm D:\JavaJDK\jdk1.7.0_06\bin\javaw.exe

MyEclipse不更新JSP

为了测试系统中的一个小功能,我很开心的修改了系统时间
然后,我发现,无论我怎么修改JSP,在Tomcat中浏览就是没有任何效果,整个一大悲剧啊

于是,我纠结了整整一下午,最后,想起来修改了系统时间
文件修改时间比修改前的还要早,当然不会去刷新啦,唉,悲剧。

将系统时间调好,删掉Tomcat下编译好的JSP目录
系统就正常啦

面壁去了~~