This commit is contained in:
Ben Fry
2015-08-17 08:42:57 -04:00
parent 3696894f16
commit 4ae51ba139
3 changed files with 11 additions and 13 deletions

View File

@@ -263,19 +263,13 @@ public class JavaMode extends Mode {
JavaBuild build = new JavaBuild(sketch);
return build.exportApplication();
}
@Override
public String getSearchPath() {
StringBuilder tehPath = new StringBuilder(System.getProperty("java.class.path"));
// Starting with JDK 1.7, no longer using Apple's Java, so
// rt.jar has the same path on all OSes
tehPath.append(File.pathSeparatorChar
+ System.getProperty("java.home") + File.separator + "lib"
+ File.separator + "rt.jar");
return tehPath.toString();
return System.getProperty("java.class.path") +
File.pathSeparatorChar + System.getProperty("java.home") +
File.separator + "lib" + File.separator + "rt.jar";
}

View File

@@ -306,7 +306,11 @@ public class ASTGenerator {
protected void loadJars() {
factory = new ClassPathFactory();
StringBuilder tehPath = new StringBuilder(editor.getMode().getSearchPath());
StringBuilder tehPath = new StringBuilder();
String modeClassPath = editor.getMode().getSearchPath();
if (modeClassPath != null) {
tehPath.append(modeClassPath);
}
if (errorCheckerService.classpathJars != null) {
synchronized (errorCheckerService.classpathJars) {