News for hackers. Stuff that matters.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by gizmogwai on Monday June 19, 2017 @11:07AM (#14587515)
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.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by spankalee on Monday June 19, 2017 @12:03PM (#14587945)
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by admax88q on Monday June 19, 2017 @01:44PM (#14588804)
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.

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by yoz-y on Monday June 19, 2017 @04:48PM (#14590329)
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.

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by copperx on Tuesday June 20, 2017 @04:03PM (#14598070)
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.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by yoz-y on Wednesday June 21, 2017 @03:16AM (#14601580)
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.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by lotsofcows on Monday June 19, 2017 @04:55PM (#14590391)
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

Wonder what the returns in their Java>JavaScript framework?

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by skybrian on Monday June 19, 2017 @02:36PM (#14589251)
I don't know about that. Modern HTML apps can easily render things that Swing never could back then.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by bastawhiz on Monday June 19, 2017 @07:14PM (#14591116)
And a fraction of the security problems? Nobody misses the Sun update dialog.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by candiodari on Wednesday June 21, 2017 @01:33PM (#14606008)
None of which are a standard or work on a general web browser. Hell, none of those work without specific command line switches even on Chrome.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by sigi45 on Monday June 19, 2017 @01:29PM (#14588672)
I don't think its an advantage. You need to install java on your pc and allow the java plugin full access to your device.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by copperx on Tuesday June 20, 2017 @04:05PM (#14598085)
Not to mention it's insanely hard to get the plugin working, and when an update is out, the plugin will refuse to run your applet until you upgrade. Java continues to be a pain in the ass.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by brentjanderson on Monday June 19, 2017 @11:02AM (#14587480)
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.

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by kodablah on Monday June 19, 2017 @11:05AM (#14587503)
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

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by azakai on Monday June 19, 2017 @12:38PM (#14588250)
Another related project is Doppio, an open source JVM written in TypeScript,

https://github.com/plasma-umass/doppio

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by roywiggins on Monday June 19, 2017 @11:31AM (#14587687)
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

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by apignotti on Monday June 19, 2017 @11:32AM (#14587697)
These are definitely bugs, please report them on the issue tracker here: https://github.com/leaningtech/cheerpj-appletrunner/issues
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by le-mark on Monday June 19, 2017 @11:38AM (#14587744)
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...

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by exabrial on Monday June 19, 2017 @03:08PM (#14589503)
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.

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by hackcasual on Monday June 19, 2017 @03:56PM (#14589920)
Running the JVM in the browser had a horrible security track record. WebAssembly operates within the well defined parameters of the pretty decent for security Javascript sandbox. I'm not sure NIH is particularly fair, especially considering the relatively quick wide spread adoption WASM has seen.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by exabrial on Monday June 19, 2017 @09:51PM (#14591694)
I disagree. The Java -can- library has a terrible record and allows for all kinds of terrible things. The JVM itself is a memory model.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by flohofwoe on Monday June 19, 2017 @03:49PM (#14589862)
What are features of the Javascript VM in current browsers that make it less powerful than the Java VM?
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by ianopolous on Monday June 19, 2017 @07:39PM (#14591214)
Single threaded, no 64 bit integers.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by exabrial on Monday June 19, 2017 @09:50PM (#14591691)
Also, dynamically typed (a feature rarely used and very costly)
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by copperx on Tuesday June 20, 2017 @04:08PM (#14598111)
What do you mean by 'rarely used'?
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by wbl on Monday June 19, 2017 @10:15PM (#14591752)
Firefox lags with GC due to a painful decision to permit C to point to JS directly.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by apignotti on Monday June 19, 2017 @11:24AM (#14587622)
More information on the technology behind this can be found here: http://blog.leaningtech.com/2017/06/announcing-cheerpj-java-...
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by jdc0589 on Monday June 19, 2017 @11:05AM (#14587501)
can't wait to try running Runescape with this and watch my CPU explode.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by 120bits on Monday June 19, 2017 @11:26AM (#14587641)
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/ 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?

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by apignotti on Monday June 19, 2017 @11:28AM (#14587658)
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.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by Recursing on Monday June 19, 2017 @11:28AM (#14587659)
You have to click on the extension and on "Run Applets" after loading the page, it works fine for me («Congratulations! You have the recommended Java installed (1.8.0_300).»)
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by xg15 on Monday June 19, 2017 @11:26AM (#14587637)
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)

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by bobsgame on Monday June 19, 2017 @01:47PM (#14588823)
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.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by jaimex2 on Monday June 19, 2017 @11:28AM (#14587653)
Neat, gives Chromebooks some new options. I have a few things I'd like to try, like Dell iDrac.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by johansch on Monday June 19, 2017 @11:00AM (#14587461)
These demos allow you to test this tech without installing an extension:

http://www.leaningtech.com/cheerpj/demos/

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

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by unclebucknasty on Monday June 19, 2017 @11:07AM (#14587512)
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

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

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by mal34 on Monday June 19, 2017 @11:06AM (#14587506)
first CheerpJ demo will download of approximately 25 MB. !!
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by kitd on Monday June 19, 2017 @11:03AM (#14587490)
> You are 2 clicks away from the applets you need or you love.

lol, so they're mutually exclusive?

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by atemerev on Monday June 19, 2017 @11:15AM (#14587559)
No, otherwise it'd be "you need xor you love".
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by yellowapple on Monday June 19, 2017 @11:09AM (#14587523)
Generally yes. I've yet to encounter a Java applet that I've both needed and loved at the same time. Every applet I've used has either been some awesome but impractical/silly toy (e.g. science demo toys) or some mission-critical but painful-to-use monstrosity (like ADP eTime or my work's HVAC interface).
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by jcwayne on Monday June 19, 2017 @11:09AM (#14587525)
That's been my experience.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by hamandcheese on Monday June 19, 2017 @06:08PM (#14590818)
A similar project is shumway, an implementation of Flash with JavaScript: https://github.com/mozilla/shumway
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by smacktoward on Monday June 19, 2017 @07:28PM (#14591177)
Shumway development has been discontinued. See https://bugzilla.mozilla.org/describecomponents.cgi?product=...
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by gadders on Monday June 19, 2017 @11:47AM (#14587810)
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?
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by y0ghur7_xxx on Monday June 19, 2017 @11:15AM (#14587563)
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.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by finchisko on Monday June 19, 2017 @11:37AM (#14587736)
this can change soon. https://wicg.github.io/webusb/
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by TallGuyShort on Monday June 19, 2017 @11:01AM (#14587470)
I've been aching for a solution to run Webex on current browsers on Linux. Sadly, this doesn't appear to do the trick.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by module0000 on Monday June 19, 2017 @11:15AM (#14587560)
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.

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by josefx on Monday June 19, 2017 @11:13AM (#14587553)
As far as I know Webex always needed the Oracle JVM and wouldn't run on anything else, so that would have been rather surprising.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by colordrops on Monday June 19, 2017 @11:23AM (#14587614)
I'm using a recently released HTML5 version of WebEx on Linux at work now. It does (did?) have a stupid bug though. When you enter your name, you have to click the button to enter the room. If you just hit enter with the keyboard it would still try to load the Java version.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by reza_n on Monday June 19, 2017 @12:09PM (#14587997)
Same, I just move the meeting to something Linux compatible like Hangouts or GotoMeeting. Also, if not presenting, Webex android/iphone client is also an option.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by stuaxo on Monday June 19, 2017 @12:09PM (#14587998)
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).

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by finchisko on Monday June 19, 2017 @11:39AM (#14587759)
Awesome piece of tech. However I guess this will not stay free forever.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by firman on Monday June 19, 2017 @09:49PM (#14591687)
I hope there is ActiveX runner, so I did not rely on IE in Windows.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by still_grokking on Friday June 23, 2017 @01:25AM (#14617188)
I like it. Java is slow again! /s
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by TeeWEE on Tuesday June 20, 2017 @04:04AM (#14592873)
Lets start running android apps in the browser!
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by TekMol on Monday June 19, 2017 @10:59AM (#14587452)
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.

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by Klathmon on Monday June 19, 2017 @11:02AM (#14587479)
The description provides some clarity (can't fit everything in a title!)

"without JVM" means you don't need a "standalone" client-side JVM install (outside of this extension).

"fully client side" means it's not doing something like "execution on a server, streamed video to the client"

and "no plugins" means it doesn't require a "chrome plugin". In chrome plugins != extensions. Flash and java were plugins, extensions are written in JS.

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by unclebucknasty on Monday June 19, 2017 @11:03AM (#14587483)
Does sound strange at a glance, but I think these are implicit references to what we traditionally know about applets: they generally required the full JRE JVM install/plugin.

So, it's advertising that this is no longer required, and that they haven't achieved it with any server-side tricks.

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by apignotti on Monday June 19, 2017 @11:16AM (#14587570)
The extension itself is actually minimal, all the real work happens inside the page by injecting a script. Also the extension is not invasive as it asks for permission on a site by site basis.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by dbh937 on Monday June 19, 2017 @11:03AM (#14587492)
"no plugins" probably means that the extension doesn't install native code, but is written in JavaScript that's run in the browser.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by diggan on Monday June 19, 2017 @11:00AM (#14587462)
Seems the extension converts Java to JavaScript before executing anything, that's why it gets by without a JVM.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by ryanpetrich on Monday June 19, 2017 @11:17AM (#14587581)
Ah, so it's merely a machine that implements a virtual version of the Java runtime.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by tootie on Monday June 19, 2017 @11:01AM (#14587473)
"Our unique Java-to-JavaScript technology converts Java to JavaScript on the fly directly on the browser."

Seems like a transpiler. But it would have to be a half-baked JVM written in JavaScript under the hood.

Re:CheerpJ Applet Viewer – Runs Java applets without a local... by hackinthebochs on Monday June 19, 2017 @01:33PM (#14588717)
And projects like this is why I use chrome. The gulf between firefox and chrome continues to expand.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by Perignon on Monday June 19, 2017 @11:49AM (#14587829)
Java applets? 2005 called, they want their hackernews posts back.
Re:CheerpJ Applet Viewer – Runs Java applets without a local... by MrMorden on Monday June 19, 2017 @05:52PM (#14590737)
Sadly, vendors are still shipping hardware that requires Java applets for critical functionality. (ASRock, I'm looking at you.)