Current jvm: functions (at least that I'm aware of) do not allow one to handle exceptions on the JVM side. Dyalog has exception handling and you can do something like
:If ⎕SE.Dyalog.JNI.ExceptionCheck env
⎕SE.Dyalog.JNI.ExceptionClear env
'Skipping: ', className
→nextIteration
:EndIf
I wrote a JAR loader, and it works for small JAR files:
loadJar "../classes/helloworld.jar"
┌Map: 1───────────────────────┐
│"HelloWorld" class HelloWorld│
└─────────────────────────────┘
But bigger JAR files give various errors that relate to the internal dependency structure:
loadJar "../classes/cobaltstrike.jar"
Error at: 40:21: callMethod: JVM Exception: superclass access check failed: class de.javasoft.plaf.synthetica.SyntheticaDefaultLookup (in unnamed module @0x3e8691d7) cannot access class sun.swing.DefaultLookup (in module java.desktop) because module java.desktop does not export sun.swing to unnamed module @0x3e8691d7
loadJar "../classes/shadow-cljs.jar"
Error at: 40:21: callMethod: JVM Exception: class org.apache.commons.io.comparator.ReverseComparator cannot access its abstract superclass org.apache.commons.io.comparator.AbstractFileComparator (org.apache.commons.io.comparator.ReverseComparator is in unnamed module of loader java.net.URLClassLoader @4ed05b28; org.apache.commons.io.comparator.AbstractFileComparator is in unnamed module of loader 'app')
The point is just to be able to skip loading those classes that cause exceptions.
Current jvm: functions (at least that I'm aware of) do not allow one to handle exceptions on the JVM side. Dyalog has exception handling and you can do something like
```
:If ⎕SE.Dyalog.JNI.ExceptionCheck env
⎕SE.Dyalog.JNI.ExceptionClear env
'Skipping: ', className
→nextIteration
:EndIf
```
I wrote a JAR loader, and it works for small JAR files:
```
loadJar "../classes/helloworld.jar"
┌Map: 1───────────────────────┐
│"HelloWorld" class HelloWorld│
└─────────────────────────────┘
```
But bigger JAR files give various errors that relate to the internal dependency structure:
```
loadJar "../classes/cobaltstrike.jar"
Error at: 40:21: callMethod: JVM Exception: superclass access check failed: class de.javasoft.plaf.synthetica.SyntheticaDefaultLookup (in unnamed module @0x3e8691d7) cannot access class sun.swing.DefaultLookup (in module java.desktop) because module java.desktop does not export sun.swing to unnamed module @0x3e8691d7
loadJar "../classes/shadow-cljs.jar"
Error at: 40:21: callMethod: JVM Exception: class org.apache.commons.io.comparator.ReverseComparator cannot access its abstract superclass org.apache.commons.io.comparator.AbstractFileComparator (org.apache.commons.io.comparator.ReverseComparator is in unnamed module of loader java.net.URLClassLoader @4ed05b28; org.apache.commons.io.comparator.AbstractFileComparator is in unnamed module of loader 'app')
```
The point is just to be able to skip loading those classes that cause exceptions.