Use your Java classes in the browser with JavaPoly.js
Java has always been usable in the browser since its creation. However, the browser needed the specific Java plugin to execute Java applications that was packaged inside applets. Then, a more flexible solution was created with Java Web Start but finally, it was always based on the applet technology. With the end announced of plugins support in browsers like Chrome or Firefox, a solution must be found to execute Java code directly in the browser. Some great developers have already started to work on a replacement solution named JavaPoly.js.
All you need to try JavaPoly.js is to import the javapoly.js library that is here : https://www.javapoly.com/javapoly.js . Your first “Hello World” program will be like that :
JavaPoly.js allows you to import and use most Java libraries. For example, you can imagine to package your HelloWorld sample class in a jar. Note that you can also import directly the .class file or even the Java source code file. If you want to include an HelloWorld.jar, you could use the following code :
The JavaPoly.js project is still very young but looks really promising with a lot of possibilities in the future. It can be a good idea to keep an eye on it and why not try it today !