Cannot import local Java classes using FFI when using JDK > 1.8...
GordonBGood opened this issue · 0 comments
GordonBGood commented
Description
The program compiles, but when run using JDK > 1.8, it crashes with an error that it can't find the imported Java class where expected as follows:
Exception in thread "main" java.lang.NoClassDefFoundError: eta/array/test/Utils
at main.Main.$wa(Main.hs:10)
at main.Main.main1(Main.hs)
at main.Main$main1.applyV(Main.hs)
at eta.runtime.exception.Exception.catch_(Exception.java:132)
at main.Main.main3(Main.hs)
at main.Main.DZCmain(Main.hs:9)
at main.Main$DZCmain.applyV(Main.hs:9)
at eta.runtime.stg.Closures$EvalLazyIO.enter(Closures.java:154)
at eta.runtime.stg.Capability.schedule(Capability.java:254)
at eta.runtime.stg.Capability.scheduleClosure(Capability.java:210)
at eta.runtime.Runtime.evalLazyIO(Runtime.java:397)
at eta.runtime.Runtime.main(Runtime.java:390)
at eta.main.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: eta.array.test.Utils
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 13 more
Steps to Reproduce
Compile and run the attached zipped project with "etlas run"; when run under JDK 11 it will compile but crash as described above; when run under JDK 1.8 it runs successfully to show the text outputs; did not try intermediate JDK versions.
Context
I was trying to test a library contribution using FFI; the workaround has been to revert to use of JDK 1.8.
Your Environment
- Did you install an older version of Eta/Etlas before? Yes, Eta version 0.8.6b3
- Current Eta & Etlas version: Etlas version 1.5.0.0; Eta version 0.8.6b4
- Operating System and version: Windows 10 64-bit with all updates to January 2019, JDK's as described.
- Link to your project: The project code is attached as: eta-ffi-helloworld.zip