Skip to content

Commit 0865a95

Browse files
committed
[#103] Add some notes about the JDK sources
1 parent 629176c commit 0865a95

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/orchard/java.clj

+10
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@
3232
;; these, we search the JDK directory and add the source classpath entry
3333
;; manually, if available. Prior to JDK9, parsing source files also requires
3434
;; having `tools.jar` on the classpath, which we'll have to add as well.
35+
;;
36+
;; The context classloader may be different at startup and in a
37+
;; REPL (e.g. nREPL) session, and these classloaders may not share a modifiable
38+
;; ancestor classloader. That's why the current implementation checks that the
39+
;; JDK sources are visible on the classpath prior to invoking the Java parser,
40+
;; and if not, adds a classpath entry for them. (see `ensure-jdk-sources`)
41+
;;
42+
;; An alternative approach would be to pass the REPL's classloader to Orchard's
43+
;; functions that modify the classpath. You can find a more extensive discussion
44+
;; on that topic here https://github.com/clojure-emacs/orchard/issues/103.
3545

3646
(defn jdk-find
3747
"Search common JDK path configurations for a specified file name and return a

0 commit comments

Comments
 (0)