
CheerpJ Applet Viewer – Runs Java applets without a local Java installation - apignotti
https://chrome.google.com/webstore/detail/cheerpj-applet-runner-bet/bbmolahhldcbngedljfadjlognfaaein
======
gizmogwai
The only, and still unmatched, advantage of using applets was having access to
external devices, such as smart card readers, in order to be used with eID,
for example. This is not possible with this plugin. The only interest would be
for some old applets you don't have sources anymore and aren't techie enough
to use a decompiler to retrieve some codebase to work with.

~~~
spankalee
Web USB: [https://developers.google.com/web/updates/2016/03/access-
usb...](https://developers.google.com/web/updates/2016/03/access-usb-devices-
on-the-web) WebB

Web Bluetooth:
[https://developers.google.com/web/updates/2015/07/interact-w...](https://developers.google.com/web/updates/2015/07/interact-
with-ble-devices-on-the-web)

and Web NFC: [https://w3c.github.io/web-nfc/](https://w3c.github.io/web-nfc/)

should start making a dent in hardware access.

~~~
admax88q
In 10 more years we'll almost be where applets where 10 years ago!

Except now in a slower single threaded language with a worse GUI toolkit.

~~~
yoz-y
If I had to pick only one flaw in Java. It would be its horrible and ugly GUI.
I mean... it managed to make anything ugly.

I agree with the broader point that web tech is basically playing catchup with
years of lag compared to existing technologies. However the one benefit we get
from all this is real security and true universal runtime.

~~~
copperx
I remember that the official Microsoft JVM (which was quickly discontinued)
used native Windows GUI controls to display the Java UI, and then later, the
JVM on Mac OS X displayed Swing(?) apps with native controls. I thought it was
all very neat, but against the interests of the companies.

~~~
yoz-y
Java applications on mac had a very uncanny way of showing native controls. It
is a bit like Qt, it kind of looks like a knock-off - elements are out of
alignment, weirdly sized and so on.

------
brentjanderson
From the description, it sounds like perhaps they transpile Java Bytecode to
Javascript?

> Based on CheerpJ, a solution to convert Java applications to JavaScript, the
> Applet Viewer extension compiles the Java applet on the fly, without relying
> on any remote server.

~~~
kodablah
Yes, from the FAQ: "The CheerpJ compiler, based on LLVM/Clang, as well as on
parts of Cheerp, converts Java bytecode into JavaScript, without requiring the
Java source. CheerpJ can be invoked on whole Java archives (.jar) or on single
.class files, and generates a .jar.js (or .js) output. "

We've seen this plenty with GWT and the likes, but this one is self-hosted in
the browser to support dynamic class loading. As with Emscripten, the real
struggle is the stdlib, not the translation. As an alternative, I would
recommend people look at TeaVM[0].

0 -
[https://github.com/konsoletyper/teavm](https://github.com/konsoletyper/teavm)

~~~
azakai
Another related project is Doppio, an open source JVM written in TypeScript,

[https://github.com/plasma-umass/doppio](https://github.com/plasma-
umass/doppio)

------
roywiggins
It doesn't seem to detect applets loaded in <object> tags, only <applet> tags,
and then only the first applet embedded on the page, which seems like an
oversight. Specifically, this one:

[http://www.morenaments.de/euc/applet](http://www.morenaments.de/euc/applet)

~~~
apignotti
These are definitely bugs, please report them on the issue tracker here:
[https://github.com/leaningtech/cheerpj-
appletrunner/issues](https://github.com/leaningtech/cheerpj-
appletrunner/issues)

~~~
le-mark
One of notch's old java 4k games, fails to start? Cpu is pegged on a core, and
the heap keeps growing. Notch used to write his own bytecode for these, would
be a good test case me thinks! More of his games on this site.

[http://www.java4k.com/index.php?action=games&method=view&gid...](http://www.java4k.com/index.php?action=games&method=view&gid=288)

------
exabrial
Applets were/are a terrible idea, but they started us down a path of
improvement that's lead us to where we're at today with browser technology.

I really wish we had a powerful virtual machine like the JVM in our browsers
though... Client-side frameworks are making the web much slower and are eating
battery life.

Web assembly is a step in the right direction, but the "not invented here
syndrome" makes my head hurt.

~~~
flohofwoe
What are features of the Javascript VM in current browsers that make it less
powerful than the Java VM?

~~~
ianopolous
Single threaded, no 64 bit integers.

~~~
exabrial
Also, dynamically typed (a feature rarely used and very costly)

~~~
copperx
What do you mean by 'rarely used'?

------
apignotti
More information on the technology behind this can be found here:
[http://blog.leaningtech.com/2017/06/announcing-cheerpj-
java-...](http://blog.leaningtech.com/2017/06/announcing-cheerpj-java-
compiler-for-webapps.html)

------
jdc0589
can't wait to try running Runescape with this and watch my CPU explode.

------
120bits
I wanted to try this out, since, my company still has some legacy code and we
use swing/applet as our frontend. It has worked very well so far, but after
NPAPI support has been dropped from Chrome and Firefox it getting tough to
keep that as our frontend now. We have slightly moved to HTML5.

I installed and went to
[https://www.java.com/verify/](https://www.java.com/verify/) on google chrome
and still says "The Chrome browser does not support NPAPI plug-ins and
therefore will not run all Java content. Switch to a different browser
(Internet Explorer or Safari on Mac) to run the Java plug-in."

Am I missing something here?

~~~
apignotti
Click on the CheerpJ extension icon and and then click "Run Applets". Sites
such as that one dynamically check if the Java plugin is available and CheerpJ
needs to refresh the page to properly spoof the plugin availability.

------
xg15
The demo takes a minute to initialize (firefox, windows 10, surface 3 pro)
then shows a window that ignores all UI conventions.

Yup, they got the applet experience nailed down perfectly :)

(Somewhat joking. The technology behind it is still extremely impressive)

------
bobsgame
I want to make a browser plugin that runs a full Linux VM with OpenJDK and
runs Java applications sandboxed in its own full OS. That way you get the full
Java capabilities and can pass through hardware that you want, or maybe give
it permissions like mobile apps. Could also run C#, native code, etc.

------
jaimex2
Neat, gives Chromebooks some new options. I have a few things I'd like to try,
like Dell iDrac.

------
johansch
These demos allow you to test this tech without installing an extension:

[http://www.leaningtech.com/cheerpj/demos/](http://www.leaningtech.com/cheerpj/demos/)

It's kinda fun to see Swing again...

~~~
unclebucknasty
Funny. Just posted about Swing yesterday and, in particular, as a solution to
what current JS frameworks are trying to achieve:

[https://news.ycombinator.com/item?id=14581407](https://news.ycombinator.com/item?id=14581407)

I'm not advocating traditional applets, but the Swing paradigm is actually
near-perfect for the job.

------
kitd
> You are 2 clicks away from the applets you need or you love.

lol, so they're mutually exclusive?

~~~
atemerev
No, otherwise it'd be "you need xor you love".

------
hamandcheese
A similar project is shumway, an implementation of Flash with JavaScript:
[https://github.com/mozilla/shumway](https://github.com/mozilla/shumway)

~~~
smacktoward
Shumway development has been discontinued. See
[https://bugzilla.mozilla.org/describecomponents.cgi?product=...](https://bugzilla.mozilla.org/describecomponents.cgi?product=Firefox%20Graveyard)

------
gadders
I currently have to use IE10 to log in to my work's Citrix remote access
solution as it is the only browser that still supports Java. I wonder if this
extension would work for that?

------
y0ghur7_xxx
the only reason we use a java applet, is because javascript has no api to
access a smartcard reader. unfortunately this project can not solve that use
case.

~~~
finchisko
this can change soon.
[https://wicg.github.io/webusb/](https://wicg.github.io/webusb/)

------
TallGuyShort
I've been aching for a solution to run Webex on current browsers on Linux.
Sadly, this doesn't appear to do the trick.

~~~
module0000
For what it's worth - you can do this with firefox(others may work, but it's
my go-to for this process).

Short summary of the steps: 1) First try to join a webex, let firefox download
and install the webex plugin 2) Look in ~/.webex, you'll see a bunch of 32-bit
binaries 3) `ldd` on the 32-bit binaries, and install the 32-bit requirements
to satisfy the missing dependencies. 4) Restart firefox, join the webex,
you're done.

The big issue is that the plugin they download assumes you are using a 32-bit
OS, and will fail to load without much in the way of meaningful error
messages.

------
stuaxo
About time :) Lots of fun and useful things were applets (OK, mostly fun
things).

It would be a shame to lose all of them (similarly for J2ME).

------
finchisko
Awesome piece of tech. However I guess this will not stay free forever.

------
firman
I hope there is ActiveX runner, so I did not rely on IE in Windows.

------
still_grokking
I like it. Java is slow again! /s

------
TeeWEE
Lets start running android apps in the browser!

------
TekMol
The title seems a bit strange to me:

"without JVM" \- providing what is necessary to run Java _is_ a JVM in my
book. That you compile Java to JavaScipt is just an implementation detail,
isn't it? EDIT: Yeah, ok. It emphasises that you don't need an extra JVM on
your computer.

"fully client side" \- isn't that how Java Applets always have been executed?

"no plugins" \- Not sure what you mean by "plugin". Installing an extension
does not match that?

Hmm.. ok, ok I am nitpicking :)

Could you instead provide a bookmarklet that runs Java Applets on websites?
That would be something I would use. I would not install an extension because
I don't want your code to run outside of the browser sandbox.

~~~
diggan
Seems the extension converts Java to JavaScript before executing anything,
that's why it gets by without a JVM.

~~~
ryanpetrich
Ah, so it's merely a machine that implements a virtual version of the Java
runtime.

------
hackinthebochs
And projects like this is why I use chrome. The gulf between firefox and
chrome continues to expand.

------
Perignon
Java applets? 2005 called, they want their hackernews posts back.

~~~
MrMorden
Sadly, vendors are still shipping hardware that requires Java applets for
critical functionality. (ASRock, I'm looking at you.)

