Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RUN .net & JRE as wasm #130

Open
frank-dspeed opened this issue Oct 9, 2020 · 1 comment
Open

RUN .net & JRE as wasm #130

frank-dspeed opened this issue Oct 9, 2020 · 1 comment

Comments

@frank-dspeed
Copy link
Member

This question has some significant parallels with how you can run C# within the browser using WebAssembly. Both Java & C# run within their own virtual machine, the JRE and .Net CLR respectively.

In order to run C# within WebAssembly, the Blazor project took one of the open source CLR implementations and compiled it to WebAssembly. This allows C# DLLs to run within the browser.

Exactly the same solution could be used to run Java in the browser, however, a key to this would most likely bee finding a suitable open source JRE implementation that can be compiled to WebAssembly.

@frank-dspeed
Copy link
Member Author

frank-dspeed commented Oct 9, 2020

Notes Jlink

Ruf einfach mal jlink --output test --add-modules java.base auf. Dann erhältst Du im Verzeichnis test ein "JRE", das nur das Base-Module enthält.

Eigene Module packst Du mit --module-path und --add-modules dazu. Wenn Du einen eigenen Launcher haben willst, packst Du noch --launcher hintendran.

jlink --output test --module-path foo.jar --add-modules java.base,meinModul --launcher meinTest=meinModul

Erzeugt ein Verzeichnis test, das ein JRE enthält, das aus dem Base-Modul und meinModul besteht. Dabei ist foo.jar ein "modulares JAR" mit dem Modul "meinModul". Außerdem wird ein ausführbarer Launcher namens "meinTest" im bin-Verzeichnis erstellt (unter Windows wäre das meinText.exe).

https://www.logicbig.com/tutorials/core-java-tutorial/java-9-changes/jlink.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant