<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Clojure Q&amp;A - Recent questions tagged java 9</title>
<link>https://ask.clojure.org/index.php/tag/java%209</link>
<description>Powered by Question2Answer</description>
<item>
<title>Should java.classpath combine classpath sources?</title>
<link>https://ask.clojure.org/index.php/8599/should-java-classpath-combine-classpath-sources</link>
<description>&lt;p&gt;&lt;strong&gt;&quot;What is my application&#039;s classpath?&quot;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;It turns out that there is not a straightforward answer to this question.&lt;/p&gt;
&lt;p&gt;There are many ways of running Java, each of which may result in different definitions of the application&#039;s classpath. The clojure.java.classpath library has, historically, used a variety of heuristics to find and return the Java classpath.&lt;/p&gt;
&lt;p&gt;The current approach is a workaround for Java 9, where the default classloader is not an instance of &lt;code&gt;URLClassLoader&lt;/code&gt;. This is now causing problems for CIDER users when &lt;code&gt;cider-jack-in&lt;/code&gt; injects the JDK source path (see below).&lt;/p&gt;
&lt;p&gt;I have been looking at the history of clojure.java.classpath, in particular:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure/java.classpath/commits/master/src/main/clojure/clojure/java/classpath.clj&quot;&gt;Git history&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLASSPATH-1&quot;&gt;CLASSPATH-1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLASSPATH-2&quot;&gt;CLASSPATH-2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://clojure.atlassian.net/browse/CLASSPATH-8&quot;&gt;CLASSPATH-8&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There does not seem to be a single approach that will give the right result in all situations.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Using the system property &lt;code&gt;java.class.path&lt;/code&gt; produces incorrect results in an application container environment (CLASSPATH-1).&lt;/li&gt;
&lt;li&gt;Getting the classpath from URLClassLoaders does not work in Java 9+ (CLASSPATH-8).&lt;/li&gt;
&lt;li&gt;Combining the results would provide more coverage for tools like CIDER and tools.namespace, but would potentially return incorrect results for applications in containers.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I am unsure how to proceed. I am wary of making yet another change to address the most-recent issue, thereby breaking older uses.&lt;/p&gt;
&lt;p&gt;See also, discussions at:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://ask.clojure.org/index.php/8288/java-11-and-tools-namespace&quot;&gt;Java 11 and Tools Namespace&lt;/a&gt; (ask.clojure.org)&lt;/li&gt;
&lt;li&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/clojure-emacs/cider/issues/2686&quot;&gt;CIDER repl doesn&#039;t work with ...&lt;/a&gt; (CIDER GitHub issue)&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>java.classpath</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8599/should-java-classpath-combine-classpath-sources</guid>
<pubDate>Sat, 14 Sep 2019 20:43:46 +0000</pubDate>
</item>
<item>
<title>Transitive dependency hell</title>
<link>https://ask.clojure.org/index.php/8326/transitive-dependency-hell</link>
<description>&lt;p&gt;It is impossible to use different versions of the same transitive dependency.&lt;br&gt;
Will it be possible?&lt;br&gt;
Can Java 9 (jigsaw) help?&lt;/p&gt;
</description>
<category>tools.deps</category>
<guid isPermaLink="true">https://ask.clojure.org/index.php/8326/transitive-dependency-hell</guid>
<pubDate>Sun, 04 Aug 2019 16:46:19 +0000</pubDate>
</item>
</channel>
</rss>