diff --git a/java/src/processing/mode/java/pdex/ErrorCheckerService.java b/java/src/processing/mode/java/pdex/ErrorCheckerService.java index 0094eb0c6..b8fabbf24 100644 --- a/java/src/processing/mode/java/pdex/ErrorCheckerService.java +++ b/java/src/processing/mode/java/pdex/ErrorCheckerService.java @@ -568,9 +568,18 @@ public class ErrorCheckerService { } // Mode class path - String coreClassPath = mode.getCoreLibrary().getClassPath(); - if (coreClassPath != null) { - classPath.append(File.pathSeparator).append(coreClassPath); + if (neededImports == null) { + String searchClassPath = mode.getSearchPath(); + if (searchClassPath != null) { + classPath.append(File.pathSeparator).append(searchClassPath); + } + } else { + Library coreLibrary = mode.getCoreLibrary(); + String coreClassPath = coreLibrary != null ? + coreLibrary.getClassPath() : mode.getSearchPath(); + if (coreClassPath != null) { + classPath.append(File.pathSeparator).append(coreClassPath); + } } // Core libraries