7 ms·
Can you compile so that JRE is bundled with the program? I'm a C# developer and I also have a kind of resistance of java - having to install JRE and now the mi
by jve 4y ago
Can you compile so that JRE is bundled with the program?
I'm a C# developer and I also have a kind of resistance of java - having to install JRE and now the minefield Oracle made with the JRE, I'm hoping not only that I don't have to code in it, but that I don't have to use ANY Java program just to avoid the runtime or have to choose between different versions of it.
And then the .jar files and how you execute them in command line is different (java -jar), maybe it is simple, but it is different than a plain executable file.
- kaba0 4y agoYes, there is in fact not even a JRE for quite some years now. Also, Oracle being a minefield is just bullshit - they are the ones that open-sourced the platform completely to the point that their paid version is only marginally different, but OpenJDK is the reference implemented. They are surprisingly good stewards of the language.
- jve 4y agoOur employer actively tracks runtime usage and makes sure we have no O in it. > The quantity of licenses is determined by the total number of employees, not the number of employees using the programs https://www.infoworld.com/article/3686611/oracle-per-employee-java-pricing-causes-concern.html https://www.infoworld.com/article/3686611/oracle-per-employe... > Employee for Java SE Universal Subscription: is defined as (i) all of Your full-time, part-time, temporary employees, and (ii) all of the full-time employees, part-time employees and temporary employees of Your agents, contractors, outsourcers, and consultants that support Your internal business operations. The quantity of the licenses required is determined by the number of Employees and not just the actual number of employees that use the Programs. https://www.oracle.com/us/corporate/pricing/price-lists/java-se-subscription-pricelist-5028356.pdf https://www.oracle.com/us/corporate/pricing/price-lists/java... Excuse me, but isn't that a minefield? Another point I don't want to use java: Now I have to understand what is Java SE and if the runtime falls under it or the development tools or how my users use the software, whether we now how to license every user that won't even use that program and even any people that interacts with our business. Pure maddness.
- kaba0 4y agoAre you using Photoshop without a license as well or how is that relevant? This is about Oracle’s JDK you specifically have to install and have a paid license to (actually, they also provide a free version if you stay on the latest LTS release at all times), and is meant mostly for governments and such. Will you uninstal linux because Red Hat has a paid support version as well?
- jve 4y agoSo if i have JDK (Which I must) I do have to buy those licenses.. for all our employees? > The Java Platform, Standard Edition (Java SE) and Java SE Universal Subscription from Oracle include the Java Development Kit (JDK), and Java Runtime Environment (JRE) https://www.oracle.com/java/technologies/faqs-jsp.html#:~:text=The%20Java%20Platform%2C%20Standard%20Edition%20(Java%20SE)%20and%20Java,Java%20Runtime%20Environment%20(JRE) https://www.oracle.com/java/technologies/faqs-jsp.html#:~:te.... Do I not need the Java SE subscription to use JRE? Do I not need the Java SE subscription to use JDK? I have so much questions and because there is even place for questions, I better avoid this thing.
- TedDoesntTalk 4y ago> So if i have JDK (Which I must) I do have to buy those licenses.. for all our employees? No, use OpenJDK like the rest of the world. It’s free and open-source.
- kaba0 4y agoDo you have to buy a license for a regular Linux kernel? No. The exact same is true for OpenJDK. Just download any, for example one that is packages by your distro, or there is sdkman for developers to let you quickly choose from multiple vendors and any version.
- jve 4y agoPlease help me understand. > To run your Java 8 application, a user needs the Java SE 8 Runtime Environment, which is available from Oracle under the Oracle Technology Network License Agreement for Oracle Java SE, which is free for personal use, development, testing, prototyping and some other important use cases covered in this FAQ https://www.oracle.com/java/technologies/javase/jre8-readme.html https://www.oracle.com/java/technologies/javase/jre8-readme.... Straight from oracle.com. How is this free? Of course I don't need to pay for Linux kernel. Of course some products feature paid support. But how can I justify the quoted text that Oracle JRE is free? I was going to say to the guy that decided there must be no Oracle Runtime at our company (some software doesn't work without it, I have no status if workaround has been found) - Hey, maybe Java SE is just the support/patches stuff and maybe we can use runtime? Until I stumble on that text - free for personal use, etc...
- Kelteseth 4y agoThis is just the public perception. Being a full time Qt dev feels more and more like using Oracle software, where the software itself is FOSS and free to use, but the company behind it makes it look like it is not, with all the negative press.
- josefx 4y ago> they are the ones that open-sourced the platform completely While I agree with the bullshit claim, Sun was the company to open source Java. Which itself goes back to IBM blocking the community process in order to force an Apache licensed Java implementation, Sun releasing the OpenJDK made most people happy without killing its embedded cash cow.
- kaba0 4y agocompletely is the important word — there were plenty of paid-only tools back then that were part of OracleJDK but not OpenJDK. Oracle made them open-source.
- jpgvm 4y agoYeah I think Oracle doesn't get the credit they deserve for OSS-ing stuff like the Java Flight Recorder. Of course their continued work on the big JVM features and GraalVM are huge for the community too.
- iforgotpassword 4y agoI think you can with 3rd party tools, as with Python, but why would you? If your app is literally a single executable with no additional resources, maybe it makes sense, but otherwise, just bundle the JVM like jetbrains does. And as you mostly use Java on the backend, you're probably running Linux where a free and open jre is packaged, so just target that and not worry about it ever.
- JackFr 4y ago> And as you mostly use Java on the backend, you're probably running in a container.
- ElectricalUnion 4y agoAssuming you have separate java services, do you really want to bundle a different "minimalistic jvm" on every container, or use containers that share the same base layers? If you use 200x images based on, say, `FROM docker.io/library/eclipse-temurin:17-jdk`, you only use 230MB + all other JAR/overlay layer sizes.
- tpxl 4y agoYou can use jlink to create a custom runtime you can distribute with your application, so that your users don't need to download a JRE/JDK. You'll still need to run this with the java command. You can use also jpackage to create an executable file you can just double-click (.exe on Windows, whatever on mac and linux).
- lenkite 4y agoIf you wish to avoid JRE, you can use Graal VM and compile to native AOT executables. Just takes a few minutes to download and play-around. (Even timed it with another Java disbeliever here on HN) https://www.graalvm.org/latest/reference-manual/native-image/ https://www.graalvm.org/latest/reference-manual/native-image...
- layer8 4y agoYou can’t use anything reflection-based I think.
- kaba0 4y agoYou can, you just have to have a config file that lists files that might get reflected upon. This is available for some of the more common libraries (there is definitely more work to do here), and you can also use an agent, run your code on a regular JVM and it will collect the runtime accesses and create that config file for you.
- circuit10 4y agoWhen I tried it the file size ended up way bigger than just packaging a JVM would be
- lenkite 4y agoThat isn't a general behaviour. You can get <5mb binary size for modest apps. Likely have one or two "bad" actors contributing to binary size. Try the Graal VM dashboard to identify which modules are bloating up the binary. "Use GraalVM Dashboard to Optimize the Size of a Native Executable" https://www.graalvm.org/latest/reference-manual/native-image/guides/use-graalvm-dashboard/ https://www.graalvm.org/latest/reference-manual/native-image... Tutorial that shows reducing binary size from 17MB to 862KB! https://docs.oracle.com/en/graalvm/enterprise/22/docs/reference-manual/native-image/guides/use-graalvm-dashboard/ https://docs.oracle.com/en/graalvm/enterprise/22/docs/refere...
- _0w8t 4y agoSingle executable is useful for end-user. It is not very relevant on servers or for development. On the other hand portability and debugging experience with jars are vastly better. Just consider a developer on Mac with Apple silicon cannot use the same executable as on Amd/Intel server, while jars are cpu-independent.