Should I move away from applets and if so, why?

I am a hobby programmer working on developing a Java game (JApplet) that runs on a web page. I've already finished coding and it works great when using Netbeans, but I have a lot of problems deploying it. I signed it and it works in sandbox mode. However, testing it on several computers (Mac and PC) and different browsers, none of them seem to want to launch applets easily.

Looking into it, it seems that they pose a high security risk (why browsers do not try to launch them), and the search for “Applets Dead / Unused” cause a lot of consistent results. I searched for alternatives and saw the following list.

  • Java Web Start (apparently also dead)
  • JWrapper (not sure I'm addicted to third-party supported code)
  • Start again in Javascript / HTML5

I do not know javascript or html5, so this would mean starting from scratch so as not to get involved in this option.

Java Web Start, it may not be as dead as people say, but I do not want to rely on the fact that after a few years it may not be supported by browsers.

JWrapper ... seems to launch the application only outside of the browser, and I would rather run it. Also not sure how long it will take to migrate from JApplet to JWrapper.

I would really appreciate some recommendations on this subject, as I play a major role in three rather dubious options.

Thank you very much in advance

Update

Thanks for all your answers. This confirms my fears that I am working on outdated technologies!

I took two things.

  • GWT for converting Java to JavaScript: I quickly looked at this, and although there seems to be a slight learning curve, this time a quick fix can be made.
  • The answer provided assumes that I should go to JavaScript and HTML5. My main problem is that I am not going to spend six months learning a new language. I may be too concerned about the learning curve. I program in C, C ++, Java, C #, so I am very good at basic coding (imho), but I have never done any side actions on the server side. Has anyone thought about how long it takes to find out?

thanks

+5
source share
5 answers

If you are serious about this, you should definitely go with JavaScript / HTML5, because this is the only option available in all major browsers, including mobile versions.

If it's just a hobby, you can still use applets, but note that Chrome , as well as Edge (the new Microsoft browser that should replace Internet Explorer) no longer supports the Java plugin. Firefox should still support it for the foreseeable future, but even they do not recommend using plugins like Java. Safari also supports it now.

Update 1

Mozilla has announced that support for NPAPI plugins, including Java, will be removed from Firefox by the end of 2016.

This means that the only browsers of its kind that still support applets will be Internet Explorer (which is not already developed) on Windows, Safari on Mac OS X, and nothing on Linux.

If you still prefer to use Java instead of JavaScript / HTML5, the only good option is Java Web Start . It uses browsers to run Java applications that do not interact with the browser after they launch.

Update 2

Firefox 52 came out today. Mozilla has dropped support for NPAPI plugins, including Java (only for Adobe Flash), starting with this version. Apple is preparing to do the same for Safari. Internet Explorer is the only major browser left with Java support for Applets.

Oracle deprecates the Applet API in Java 9.

+2
source

Also take a look at Vaadin ( https://vaadin.com/framework ) as a way to launch a Java application as HTML5 in a browser. It has a similar programming model for all Java, like GWT, but also automatically handles the communication between the server and the client. This is an open source project and has a large library of components.

0
source

You can also use your own messages to link your native application with the Chrome extension or Chrome applications, but this fix will only work for Chrome.

Own posts

In Firefox, perhaps you can use:

js-ctypes

0
source

I have successfully deployed Java Web Start without any problems since the first warning that Chrome will abandon Java applets

Now I'm working on a replacement using HTML5, so far it can do about 50% of what a Java applet (or a Java application when launched using Web Start) can do

0
source

Firefox version 52 can still run Java applets. On the about: config page, create a new boolean value of plugin.load_flash_only with a false value. Or you can directly use the version of Firefox ESR (entreprises). Hope this helps.

0
source

All Articles