plasma-umass / doppio

Breaks the browser language barrier (includes a plugin-free JVM).
http://plasma-umass.github.io/doppio-demo
MIT License
2.17k stars 176 forks source link

Help in my first Doppio app #499

Open jsfan3 opened 7 years ago

jsfan3 commented 7 years ago

Hello, I followed the instructions to put Doppio inside a web page, but I wasn't able to run a jar in a web page: I get a blank page.

I attach my project (I omit java_home content because it's too big): what's wrong? myapp.zip

Thank you very much for any help.

P.S.: Does the browser have to load all the java_home content (97 MB)? If it's so, I figure that it cannot be used in real world use cases.

jvilk commented 7 years ago

Does the browser have to load all the java_home content (97 MB)? If it's so, I figure that it cannot be used in real world use cases.

DoppioJVM needs to load all of the classes that might be used at runtime. The 97MB java_home compresses into ~40MB. The DoppioJVM demo loads and decompresses a gzipped Java home into browser storage, so the user only needs to download the files once. I think this download is acceptable in certain scenarios.

It is possible to reduce java_home's size by removing components/classes your program does not use. Historically, this is hard to do in Java, although I believe that is changing in Java 9.

I wasn't able to run a jar in a web page: I get a blank page.

I haven't looked at your code yet, but I'm confused by your question!

When you add DoppioJVM to a webpage, it doesn't add any GUI components or anything. It's like any other JavaScript library; you need to integrate it with your webpage. If you expected a terminal interface, you'll need to build the DoppioJVM demo and use that.