How to use java.util package in method? #35
Replies: 1 comment
-
Which build system do you want use? Do you want write your own build tool? You does not need to add the jar file of the JDK. JWebAssembly use the classes of the current Java VM. You can use any class from the JDK in your program that can be compiled to the target. This means for a browser that you can't never use any with a file. For WASI can it be possible if any declare the API in library and the WASI runtime support a GC. Reflection and Unsafe is not supported yet. Many classes of the JDK have a indirect dependency to one of this features and will fail. ArrayList should work. But Scanner use the steaming API which has a dependency to Unsafe. I work currently on a solution. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have been experimenting with this new project and so far I have been amazed by the capabilities of JWebAssembly. I wanted to try something more advance and was wondering whether it is possible to use the java.util package, specifically ArrayList and Scanner in a method.
So far I have tried to download a jar file of java8 JDK and used the addLibrary method shown below.
Although, I don't understand how to use the classes inside the jdk8.jar file in my method. I'm not even sure if it is possible to use ArrayList and Scanner, but if there is a way with this method or another more sensible approach, your help will be greatly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions