On 16/07/2016 08:18, Jochen Theodorou wrote:
:
Just as an example... because the JVM used to have a URLClassloader
when starting, it was possible to add classes there at runtime and
@Grab was born to make use of that. Now this is no longer possible,
@Grab will no longer work on JDK9 in many many cases. Why is that
technical debt? There is simply no way to make this work like before
anymore.
I realize this is off-topic for the thread but just to say that the JDK
has never had (aside from the APIs in JVM TI and java.lang.instrument) a
supported/documented way to do this. You are right that some tools and
libraries have restored to a bit of hackery, specifically casting the
system class loader to a URLClassLoader and hacking into its protected
addURL method but that is making an implementation assumption. We know
at least some has been to work around command line length limits -
Gradle comes to mind but then have switched to using @argfile. The more
general "I want to extend the class path at runtime" is probably
something that should be discussed (on another thread).
Separately, is @Grab partly to workaround issues with @CS methods? The
issue with JDBC using @CS methods is one that you brought up on another
thread and there is work in progress to fix that long standing issue.
-Alan
[1] https://issues.gradle.org/browse/GRADLE-3287