Hacker News new | comments | show | ask | jobs | submit login

Yes, it's always amazed me how such a simple thing gets screwed up.

Here on Ubuntu I had to write a custom minecraft launcher just so that I could launch the .jar from my desktop.

You can use the binfmt_misc kernel module to configure Linux to automatically launch Jar files that are marked as being executable. See: http://www.mjmwired.net/kernel/Documentation/java.txt

That Ubuntu doesn't do it by default, that's just their choice (a sane choice I think).

Hold it!

Kernel module seems a bit drastic. You can just change the file association.

I'm tempted to downvote this, but maybe you know something I don't. The kernel module allows you to chmod +x a class, jar, or applet and execute it from the command line. Or run it from a script, or exec() it, or whatever. It essentially makes it a real executable alongside ELF. Is there some other way to accomplish this? What file association do you mean?

I believe he's talking about configuring your desktop environment such that it will launch .jar files with java (perhaps through a script intermediary), which is indeed not nearly as cool as what you're describing.

Given that the original comment here said "from my desktop", I assume he means something he can click, and associating jars with the JRE in the desktop environment is probably a reasonable solution.

Yeah, and I rarely use java command line utilities, personally, with one exception.

Applications are open for YC Summer 2018

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact