11 ms·
Java in the Browser
- adrianmsmith 4y agoI have looked around the website and I really have no idea what this is. I feel their marketing and doc could do with a bit more explanation if it's intended for devs. Is it like applets in that there is a runtime in the browser? Or more like GWT which compiles Java to Javascript? Also, the website which is apparently created with the technology, is incredibly slow, at least for me. And the website doesn't give useful loading indicators, e.g. click a link, nothing happens, or go to the doc section and navigate and lots of empty screens (presumably while the content is loading). No browser loading indicator, nor spinner in the content.
- qsort 4y ago> I have looked around the website and I really have no idea what this is. Judging from the browser developer tools, something that (very slowly) sends the client stuff via a socket.
- JLCarveth 4y agoThe calendar demo I tried was quite slow as well.
- twic 4y agoFrom elsewhere (site is down for me): > jpro is a new technology which brings Java back into the browser — without Java Plugin. To achieve that, jpro runs JavaFX on the server and maps its scenegraph directly into the browser. JavaFX is the most recent of the standard GUI libraries for Java. Seems like the Java all runs server-side, but it is effectively using a display device which is "send draw commands via a websocket to a JavaScript driver running in a browser". It's sort of an ingenious idea. I assume the target market here is companies which already have custom desktop applications written with JavaFX, and want to make them available remotely. This is competing with remote desktop solutions, not React, wasm, etc.
- rch 4y agoI used a graph analysis app ~2011 that communicated with the server over zmq and rendered via lwjgl. At the time, and perhaps even now, it wouldn't have been reasonable to expect adequate performance if all the results of interactive manipulation were executed on the client hardware. Which was unfortunate for me since I'd also spent a few weeks writing code to visualize the same data, and it was definitely a 'works on my machine' application. I've considered revisiting the problem, but probably not following the implementation discussed here.
- prionic6 4y agoIt sounds a lot like Eclipse RAP / RWT which is basically swt in the browser. The biggest downside is that every user has a heavyweight session on the server that holds all the UI state. I think Vercel is also a bit similar to this model.
- marwis 4y agoA Swing version of the same idea: https://jetbrains.github.io/projector-client/mkdocs/latest/ https://jetbrains.github.io/projector-client/mkdocs/latest/
- specialist 4y agoInteresting. Runs app on the server, does final rendering of the UI's scene graph on the client (within the browser). It's not clear from skim reading if the client side rendering is implemented with the DOM or a canvas element. I've always thought it'd be hysterical to use canvas. The whole browser just to hoist a client side frame buffer. X-Windows reinvented. FWIW, JavaFX is so close to The Correct Answer™. Definitely the best effort thus far. (I haven't used SwiftUI yet.)
- luzifer42 4y agoThe canvas is a powerful tool, especially if you do a lot of graphical work. Rendering the entire UI yourself, gives you complete freedom of layout management. Plus, you avoid any DOM manipulation, directly or through a myriad of JavaScript frameworks. Remember: there is no silver bullet. Example: https://www.isochart.com https://www.isochart.com
- kevincox 4y agoBut you also lose a ton of browser features such as options to open links in new tabs or download them, spell checking, search for selected text, find in page, shortcuts to jump to links... You can reimplement each specific feature but you will never get all of the features in every browser.
- jwandborg 4y agoMy interpretation of "it's hysterical to use canvas" was that it would be hysterical to draw content elsewhere and then send it to the browser for display. Implementing something that looks like and behaves like a web page in a canvas on a web page is a "of course it's possible, but there must be a better solution" moment. If you then have to pay for the amount of RAM of your central layout/rendering process, it would make it hysterical, as in "maybe we could pay less for RAM if we figured out how to offload layout and rendering to the client". There's probably a niche for this still, because Java isn't inherently bad (pun intended), and if you run out of time but keep getting requirements, this thing could make your existing app be more like a web page, but if you're starting from scratch, why wouldn't you not use this?
- pavlov 4y agoJava in the Browser, February 1996 edition: http://www.antipope.org/charlie/old/journo/netscape.html http://www.antipope.org/charlie/old/journo/netscape.html
- quickthrower2 4y agoI made an applet in ‘99. As good as a React app these days.
- solardev 4y agoTotally forgot that Netscape had email and a usenet client built-in! What nostalgia. It's funny to me that the original use case of Java -- write-once, run-anywhere -- was eventually overtaken by Javascript, a language that had nothing at all to do with it and just wanted to steal its name for marketing. Well, guess it worked? lol
- robertwt7 4y agothere's a price for this?? I'm not sure what this is by looking at their homepage, is this similar to WASM? also who would pay to develop something for the web anymore?
- pjmlp 4y agoEnterprises that aren't going to rewrite from scratch and rather look forward to solutions to keep existing code running. The same reason IBM and Unisys keep their mainframes and microcomputers running with updated hardware.
- Koshkin 4y agoLooks like it’s a custom webserver.
- samwillis 4y agoSite appears to be down, there is an archive here from June 2020: https://archive.ph/mJDAT https://archive.ph/mJDAT Newer archive on IA from March this year doesn't load anything: https://web.archive.org/web/20220316200857/https://jpro.one/ https://web.archive.org/web/20220316200857/https://jpro.one/ However has source code including: <jpro-app loader="none" href="/app/default" fxcontextmenu="false" fullscreen="true" nativescrolling="true" fxheight="true" snapshot="auto" userselect="true"></jpro-app> So assuming there was a newer site that had some sort of embedded Java thing... By the sounds of it, it was a demo where the website ran as java on the server, rendering and pushing to the browser in real time? Guessing it couldn't handle HN traffic...
- opvasger 4y agoit's sort of funny - I expect Java in the browser not to work well (as it didn't, historically)... And sure enough - the site returns a 502 error :P
- moffkalast 4y agoA self fulfilling prophecy.
- bschwindHN 4y agoThis is very advanced satire.
- stall84 4y agoI busted out laughing
- TacticalCoder 4y agoAnyone remember that Java applet in the nineties where there was some 2D wireframe "animal" moving in a rectangle and there was, IIRC, a tiny circle at each joint and you grab it and move it and it'd move the thing around / distort it. It was the first "serious" Java in the Browser I remember. It was all black & white. Maybe some HNer (not an HNer back then obviously) wrote it back in the days?
- CmdrKrool 4y agoI remember! Perhaps that is Soda Constructor: https://en.wikipedia.org/wiki/Soda_Constructor https://en.wikipedia.org/wiki/Soda_Constructor http://maciejmatyka.blogspot.com/2018/02/soda-constructor-revisited.html http://maciejmatyka.blogspot.com/2018/02/soda-constructor-re...
- deleted 4y ago[deleted]
- jmiskovic 4y agoSoda Constructor? Yeah, that was a fun one. Here's a decent JS clone for some nostalgia: http://panoramx.ift.uni.wroc.pl/~maq/lovesoda/0.36beta.html http://panoramx.ift.uni.wroc.pl/~maq/lovesoda/0.36beta.html
- matsemann 4y agoHuh, I once made a workshop where people used evolutionary algorithms to make a similar shape learn to walk (see gif on top here https://github.com/Matsemann/walkingea https://github.com/Matsemann/walkingea ).
- rzzzt 4y agoThere is a paper on two-legged animals learning different methods of walking: https://youtu.be/pgaEE27nsQw https://youtu.be/pgaEE27nsQw (or https://youtu.be/FahK9srJq10 https://youtu.be/FahK9srJq10 for the slightly better known "music video" version). Soda Constructor's wikipedia page also links to a 3D applet named "Springs World 3D", I was playing with that one back in the day.
- StevePerkins 4y agoI don't know if the performance is terrible in general, or if the demo site is getting crushed by HN traffic at the moment. If it's the former, then this is completely useless. If the latter, then I suppose it COULD have some use cases for internal tools and dashboards, in small to mid line-of-business shops that don't have many front-end developers on staff (i.e. basically a competitor to .NET's Blazor). The REALLY interesting thing here is that this product isn't licensed per-server, or per-CPU, but rather "per 8GB block of RAM"! Look, I love Java. It's helped me build a great career, build a future for my family, and I really do believe that it's the best developer experience out there for the server-side. However, the idea of licensing a Java-based product by its memory usage makes me laugh out loud.
- solarkraft 4y agoThat's actually an interesting way to encourage efficient resource usage.
- voidwtf 4y agoEfficient resource usage or Java. You can only choose one :p
- deleted 4y ago[deleted]
- dixie_land 4y agomaybe that's the selling point? I opened up one demo and despite it is indeed running the browser, it definitely _feels_ like running an AWT widget in ActiveX! oh the memories!
- floriankirmaier 4y agoIt was the HN traffic. Usually it's very smooth.
- nextaccountic 4y ago
- oaiey 4y agoI do not know. .NET created with Blazor a modern Applet tech stack based on WebAssembly and HTML. Would not Java be able to do the same and just port the applet API onto a Canvas? Would not that reactivate a whole existing ecosystem?
- pjmlp 4y agoJava solutions for JS and WebAssembly as targets are older than Blazor actually, see TeaVM and CheerpJ, and then there was GWT alongside Vaadin.
- kaba0 4y agoYou left out probably the most widely used one, Google’s j2cl compiler (java->js), which is used quite extensively in many google products for shared business logic. It is the spiritual inheritor of GWT.
- pjmlp 4y agoAh, wasn't aware of it.
- oaiey 4y agoChherpJ seems more like a browser extension. TeaVM sounds like it at least from the runtime perspective (not so much from app model.. neither applet or Blazor alike? ... But indeed it is older). I think TeaVM could be the foundation to run applets on a WebAssembly and not browser extension.
- TeaVMFan 4y agoYes, TeaVM predates Blazor and still has the edge on most fronts: https://frequal.com/java/TeaVmVsBlazorWasm1-0.html https://frequal.com/java/TeaVmVsBlazorWasm1-0.html Comparison Chart: https://frequal.com/java/TeaVmVsBlazorChart.html https://frequal.com/java/TeaVmVsBlazorChart.html
- oaiey 4y ago
- invalidname 4y agoSite is down but it seems like server side rendering which is pretty terrible. There are better solutions for Java developers such as teavm one which Codename One built the web UI support. It supports both web assembly and plain JS. The latter has the advantage of smaller size. Transpiles Java threads into async/await calls. Pretty cool stuff.
- pjmlp 4y agoJPro can also target WebAssembly.
- ziftface 4y agoWhat's so bad about server rendering
- invalidname 4y agoWell.. I come from the age of dumb terminals so trauma. We have powerful machines today. Using them like a dumb terminal rubs me the wrong way.
- ziftface 4y agoI've recently come to appreciate server rendering for its simplicity, at least for the tasks it is suited for. But I know what you mean. As a user, it's better to have local apps doing the real work.
- pjmlp 4y agoWelcome to cloud computing.
- invalidname 4y agoServerless is the new timeshare.
- pjmlp 4y ago
- manholio 4y agoNow someone please compile a real JRE into WASM and do it right, so I can revive applets with a simple embed. There are loads of old applets that have huge historic and technical value which are becoming harder and harder to use. Example: https://www.grc.nasa.gov/www/k-12/rocket/ienzl.html https://www.grc.nasa.gov/www/k-12/rocket/ienzl.html
- yuri91 4y agoHere you go: https://chrome.google.com/webstore/detail/cheerpj-applet-runner/bbmolahhldcbngedljfadjlognfaaein?hl=en https://chrome.google.com/webstore/detail/cheerpj-applet-run... CheerpJ does exactly that: it ships a full JVM implementation (including Swing/AWT, Threads, ...) that runs in JS/Wasm inside your browser. The Applet Runner extension detects applets in the page and runs them through CheerpJ. The example that you list seems to work.
- manholio 4y agoI know about the extensions, it's exactly how I was able to run that specific applet, but that's a high friction experience for the user. If the applet does not run it's very unlikely I will install an extension (or search for a Firefox alternative) unless I'm very motivated. I'm thinking more like a line or two you can add to your pages hosting applets, and it would enable any modern browser to use it. Minimal friction for the webmaster, zero friction for users.
- yuri91 4y agoThat is also possible: https://docs.leaningtech.com/cheerpj/Getting-Started https://docs.leaningtech.com/cheerpj/Getting-Started See "Converting an applet"
- slowmotiony 4y agoWe still use Java applets at work. For example the IBM Host On Demand is used by the cobol/mainframe folks in a lot of banks and other financial institutions. I hate it so much.
- peterkelly 4y agoI thought we tried this already...
- bmacho 4y agoAnd it was way better than anything before and after, but the current politics the given time killed it (which may or may not be relevant anymore).
- dhosek 4y agoThe load times and performance for applets were all pretty dismal, and given that about half of them were a site logo with moving waves at the bottom, not so missed. That said, I have a Number Theory textbook which uses computer-assisted explorations (e.g., get lists of pythagorean triples, factor a bunch of large numbers, etc.) and the most accessible version of those was through a set of applets which are challenging to run now (it also has Maple and Mathematica versions of the explorations).
- kaba0 4y ago> The load times and performance for applets were all pretty dismal Javascript was abysmally slow as well, but then it got some insane amount of man-hours spent on it. Also, with that internet speed, everything was slow - I don’t see why would that be a valid criticism against java, especially that Java byte code is insanely compact, much more so than minified js. I think it was just ahead of its time, and Java itself could have easily been used as the web-native language if it is made to interact with the DOM natively.
- cesarb 4y ago> Javascript was abysmally slow as well From what I remember, the Java VM took around a minute to start the first time you opened any page with a Java applet, and it locked the whole browser while it started. Compared to that, Javascript loaded instantly. Also keep in mind that much less was done in Javascript back then, so even though it was interpreted, it didn't feel that slow. > and Java itself could have easily been used as the web-native language if it is made to interact with the DOM natively. From what I recall, a Java applet could interact with the DOM directly (even though most applets didn't); the DOM specification had both Java and Javascript as targets, and it always felt to me that it favored the Java style in its interfaces.
- mondainx 4y agoWASM really is the way to go for this kind of thing IMHO; I love me some Java and have for decades, but Applets were painful, especially when hooking in native code. HN seems to have killed the demo, I'll have to remember to come back later when the hoopla dies down.
- jeffreportmill1 4y agoWell this isn't helpful for those of us that care about Java in the browser. In any case, JPro is really more "Java projected in the browser" (or like twitch/remote-desktop). It's a shortcut with significant drawbacks. I'm more a fan of TeaVM, CheerpJ, J2CL and JSweet. https://reportmill.com/snaptea/ https://reportmill.com/snaptea/
- phendrenad2 4y agoAre you building Java apps that need to be in the browser, or are you a fan of the concept of Java in the browser?
- TeaVMFan 4y agoActual Java in the browser (working, fast, passes Lighthouse) with TeaVM: https://blogs.oracle.com/javamagazine/post/java-in-the-browser-with-teavm https://blogs.oracle.com/javamagazine/post/java-in-the-brows... For example, try this 5-letter word game: https://frequal.com/wordii/ https://frequal.com/wordii/
- exabrial 4y agoNice username :) It looks like TeaVm is still setting steady releases? It’s certainly bucking industry trends, which concerns me about maintenance.
- TeaVMFan 4y agoYes, TeaVM is still actively maintained by the original author (and contributors). Java 17 record support was recently implemented, for example. TeaVM is coming up on 10 years, so it has proven its longevity.
- pestatije 4y agoSee also: Migrating Browser-Based Java Applets to IcedTea-Web Using JNLP https://news.ycombinator.com/item?id=32565828 https://news.ycombinator.com/item?id=32565828
- dukoid 4y agoThis sounds more like server-rendered again if I understand this correctly? Is there actually a DOM-based AWT emulation for J2cl (GWT) or TeaVM that can be used to actually run old Applets purely in the browser?
- ksherlock 4y agoThere was also Browser in the Java - HotJava, Sun's circa 1996 web browser written in Java. https://en.wikipedia.org/wiki/HotJava https://en.wikipedia.org/wiki/HotJava
- stall84 4y agowait a minute .. LOL!!!
- butz 4y agoTime to update "3 Billion Devices Run Java" message.
- gabereiser 4y agoSo I guess we’ve come full circle now? Java was the first to run in the browser (via applets).
- cryptonector 4y agoJava in the browser used to be called applets, no? Anyways, it failed, thought that probably had a lot to do with: JavaScript being more accessible (still is) and the security model for applets (JAAS) being rather lame (it was, and still is, and it continues to exist in spite of applets being gone because JAAS metastasized).
- phendrenad2 4y agoYes. Java was removed from browsers due to "security concerns", and yet, here we are, compiling Java to WASM and running it in the browser. Truth is, removing it was more of a political move against Oracle.
- floriankirmaier 4y agoSome notes from the developing company: First of all, sorry for the bad performance in the first hours after this post. The server isn't setup up for a big traffic peak. It was way higher than we are used to. To improve the performance, we increased the memory. Many of our demos represent heavy business applications. Especially the "FlexGanttFX Demo" is a good example. With JPro the Application itself runs "logically" in the server, and the rendering happens with javascript in the client. Usually, the performance is very fast - and the architecture is not noticed by the user. Feel free to ask any further questions.
- prionic6 4y agoIs it like Eclipse RAP, just for Java FX? How does it compare to Gluon?
- deleted 4y ago[deleted]
- elwell 4y ago"Your scientists were so preoccupied with whether or not they could, they didn't stop to think if they should." - Dr. Ian Malcolm
- Joyfield 4y agoGb != GB.
- paultopia 4y agoProposed subtitle: "the original sin"
- nice_byte 4y agoI tried the demo website - it takes seconds to respond to clicks, even on an M1 mac. I'd rather set myself on fire than use software built using this technology.