Live data from Hacker News

Using Java 9 Modularization to Ship Zero-Dependency Native Apps

steveperkins.com

111–117 of 117 posts

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#111
post #59

So, after "optimizations [...] to further reduce the resulting bundle size", a Java command-line "Hello World" is still 21.7 MB. I've found a Node.js version (using node-packer [1]) to be about the same size. However, as mentioned in the article, "Hello World" in Go is an order of magnitude smaller. The article may be right that Java is "the best choice available" for cross-platform GUI apps, but for cross-platform c…

People need to stop comparing app sizes of "Hello World" apps and use a more real, more complete application as an example. One that does most of the things that one would do in the platform, for starters.

If we "compare by Hello World" then Assembly/handwritten bytecode would win, but what's the point?

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#112
post #3

While Electron's popularity was a boon to the desktop app scene, I keep on dreaming that JavaFX applications made with Kotlin, jlink, Gluon's scene builder (or maybe even something better) will gain enough popularity to attract a healthy open source community for cross platform desktop apps. It feels like the tools are almost where they need to be and finally coming together!

OK, so question time: I haven't done any Java (let alone Kotlin) coding now for what seems like ages, but will need to implement a relatively simple, yet cross-platform client for my upcoming application. It will probably sound extremely silly, but were I to write a GUI that speaks to a REST API, where should I start doing my research?

If you have more recent experience on C++, Python or Javascript then you should be looking into Qt, PyQt, Electron (respectively) or other alternatives first, but if you're willing to try the Java environment you could look into the following components to get you started:

-Kotlin to speed up development

-Gradle as a dependency manager

-Retrofit + OkHTTP to create a type safe backend API definition

-JavaFX for the GUI components

-Gluon's scene builder if you like creating your FX views in xml, with a visual editor

-RX as a powerful library for async tasks

-Gson or Jackson as a JSON parsing library

-IntelliJ if you like coding with IDEs, for its massive refactoring capabilities

It's a lot to take in if you're unfamiliar, but together they all come to form really solid desktop applications.

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#113

Earlier quoted context omitted.

Are you joking? I can't tell. Just in case you aren't, what do you think is required for a platform to support Hi-DPI displays?

For what's it's worth, I've written Java 8 on macOS and it 'just works'. I didn't have to do anything to make it look good in hidpi.

Yes, it works on Mac, but not on Linux...

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#114

Earlier quoted context omitted.

I still haven't found anything better than IntelliJ's triple column view for resolving merge conflicts. Is there anything similar in a more lightweight editor?

If you don't mind having it separate from your main editor, Meld is great.

Interesting that this is touted as one of the "best" uses of Meld[0]. Will try this out tomorrow.

0: http://meldmerge.org/help/resolving-conflicts.html

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#115
post #85
post #59

So, after "optimizations [...] to further reduce the resulting bundle size", a Java command-line "Hello World" is still 21.7 MB. I've found a Node.js version (using node-packer [1]) to be about the same size. However, as mentioned in the article, "Hello World" in Go is an order of magnitude smaller. The article may be right that Java is "the best choice available" for cross-platform GUI apps, but for cross-platform c…

Since Go and Electron are mentioned, let me offer a web UI library for Go: https://github.com/zserge/webview (I know UI has been a problem for Go apps for a while and is often a stopper when it comes to writing desktop apps in Go). The library creates a full-screen webview window and lets you write UI code in HTML5/CSS/JS connecting it to the core app logic written Go. It provides JS-to-Go bindings allowing to call G…

This looks pretty cool. I noticed on windows this uses mshtml. What browser tech does this use on windows 10?

Another question is around intercepting xls/doc responses to load them into office. Is there a way to do this with this framework?

Thanks!

Re: Using Java 9 Modularization to Ship Zero-Dependency Native Apps

#117
post #85

Earlier quoted context omitted.

Since Go and Electron are mentioned, let me offer a web UI library for Go: https://github.com/zserge/webview (I know UI has been a problem for Go apps for a while and is often a stopper when it comes to writing desktop apps in Go). The library creates a full-screen webview window and lets you write UI code in HTML5/CSS/JS connecting it to the core app logic written Go. It provides JS-to-Go bindings allowing to call G…

This looks pretty cool. I noticed on windows this uses mshtml. What browser tech does this use on windows 10? Another question is around intercepting xls/doc responses to load them into office. Is there a way to do this with this framework? Thanks!

On Windows 7 SP1 it uses IE11. Same on Windows 10. On some Windows 8 it might use IE10, which is still not that bad.

Sorry, can't tell much about xls/doc. It's aimed to be a web UI for your app. Normally, you app would be a web server then. So if you want to handle certain requests and open external apps - you surely can do it.

Post reply on HN