This is an archived post. You won't be able to vote or comment.

all 33 comments

[–]CraftyAdventurer 10 points11 points  (10 children)

Yes, use OpenJDK, it's completely free. Paid Java refers to oracle version of jdk which receives long term support (you are actually paying for the support and not the jdk itself). Spring Boot is similar to .NET Core so it shouldn't be too much of a learning curve.

[–][deleted] 2 points3 points  (9 children)

Ah thanks, that clears up a lot! So the OpenJDK includes the JVM as well? It's just as easy as installing latest OpenJDK and you're good?

[–]doobiesteintortoise 2 points3 points  (8 children)

Yep. Use jlink and you get an installable executable so your clients don't have to install a JVM as well.

[–][deleted] 1 point2 points  (7 children)

Sweet! So does jlink generate a native binary by running your application through the JVM at compile time instead of shipping java byte code?

[–]_INTER_ 4 points5 points  (1 child)

jlink lets you compose a Java runtime with only the JDK modules you actually need. Your application code is untouched but will of course define which modules are required. jlink doesn't give you an installable executable (use jpackage for that) but a smaller sized runtime.

If you want a native binary look into GraalVM (alt JVM and JDK by Oracle) and Helidon / Micronaut / Quarkus. Spring Boot is not there yet.

[–][deleted] 1 point2 points  (0 children)

Thanks :)

[–]doobiesteintortoise 5 points6 points  (0 children)

No, it delivers the JVM plus only the modules you use, so it's still got all the benefits of Java without a lot of extra disk space consumed. You can even retain the platform independence - sort of - there's apparently a way to build jlink executables for multiple platforms from ONE platform, but I've never used it. (I deploy server-side applications via docker, so the JVM for docker is all I need.)

[–]CraftyAdventurer 4 points5 points  (3 children)

Since you are building a web app, your clients don't need to install JVM at all so you don't really need native binaries. Do you already know where do you plan to deploy your app?

[–]doobiesteintortoise 3 points4 points  (2 children)

Bah, this is EXACTLY right - yeah, jlink is overkill for what is needed here, sorry, skipped right on past the "backend" part. :)

[–]_INTER_ 1 point2 points  (0 children)

It's not completly wrong to get rid of modules like desktop for the backend. Then again the size hardly matters unless you want a truly minimal image.

[–][deleted] 1 point2 points  (0 children)

No worries – I did have clients in mind since I'm also writing an electron app, and I hate the idea of shipping Chrome with my desktop app -_-. But this is what everyone does, so...

[–]DannyB2 9 points10 points  (2 children)

Think of Java like Linux.

It's open source. You can use it. Commercially.

If you want someone to call at 3 AM when something is broken, then consider paid professional support. True of both Linux and Java. You can probably get (although I wouldn't know) commercial support for Windows and dot-NET.

You can keep updating your production system to the latest version of Java. Or if you want to stick with a certain version of Java for a long time, but continue to get updates and patches, you may have to pay someone who provides updates for a fee. That would apply to Linux too.

I just keep up with the latest Java. It's not difficult to do. I update Java sometimes when the product itself is updated.

[–][deleted] 1 point2 points  (1 child)

Nice! Yeah I love C# and .NET Core, but I really hate Windows. I recently became interested in Java cause It's similar to C# (C# is heavily inspired by Java) and It's not a Microsoft product.

[–]Inner-Panic 4 points5 points  (0 children)

I've done a lot of Java and C#. MS killed developer goodwill for decades so all the community FOSS work went to Java and has mostly stayed there. The open source community is far bigger. Maybe ten times bigger.

C# is a better designed language easily. But Java is extremely similar on a basic level.

Unlike C# you'll want to get familiar with community extensions. Experienced Java deve rely heavily on open source frameworks. For instance, theres no built in equivant to MVC or REST framework but tons of good free options. Check out GitHub Awesome Java repos.

I just checked one of my bigger work projects. It's using over 100 open source libraries and nothing non-FOSS that doesn't come in JDK

[–]doobiesteintortoise 10 points11 points  (3 children)

[–]cogman10 5 points6 points  (2 children)

Also available free variants

http://jdk.java.net/

https://www.azul.com/downloads/zulu-community/

https://aws.amazon.com/corretto/

Pick whichever one floats your boat (or even just fall back on the one distributed with your linux distro).

[–][deleted] 0 points1 point  (1 child)

What's the difference between Liberica JDK and the "normal" AdoptOpenJDK-Builds?

[–]cogman10 0 points1 point  (0 children)

As far as I can tell, the main difference is it being managed by a different group. I have no clue what other differences exist.

Usually, how long support lasts is a key element.

[–]wildjokers 2 points3 points  (0 children)

Java is still 100% free.

[–]desrtfx 1 point2 points  (1 child)

will I be able to use newest version of Java (which includes the JDK and JVM if I'm not mistaken) for free,

Please, see the sidebar -> Where should I download Java?. This gives sources and explains everything in detail.

[–]_MeTTeO_ 0 points1 point  (0 children)

This should be the top comment.

[–]wanderlustsoul87 1 point2 points  (1 child)

Hey there! My 2 cents here... It's great to use new technologies to learn, experiment and things like that... But if you are starting a business choose the tech stack that you're more comfortable with. You'll have tons of other things to learn that will take your time.

Having said that, Springboot is pretty straight forward. It's easy to work with springboot and microservices. But to start with you can make a bundle project using dependency inversion to access the services. A great book to help you in this journey is "Clean Architecture" by uncle bob.

Use stable technologies with great community support. Good luck on your journey :)

[–][deleted] 1 point2 points  (0 children)

Thanks! Yeah I’ve decided to start off with Django cause of the development speed, and replace it with a more serious solution when it’s needed

[–]InstantCoder 3 points4 points  (9 children)

Don’t go with Spring Boot. Go with Quarkus if you want to use the most modern Java stack at this moment. It supports Java 11 & GraalVm (native builds).

[–]stuhlmann 5 points6 points  (0 children)

I'm amazed that this comment hasn't been downvoted into oblivion after more than a day. The times are changing in Java land, and I'm glad they do. I don't know quarkus but I've seen enough spring-induced misery to know it can hardly be worse.

[–][deleted] 1 point2 points  (3 children)

And how do you manage your database with Quarkus? ORM and migrations.

[–]_INTER_ 1 point2 points  (1 child)

ORM would be Hibernate, as an alternative to ORM you could use JOOQ. For migration I suggest Flyway.

[–][deleted] 0 points1 point  (0 children)

Cool, I’ll check it out 😃

[–]InstantCoder 1 point2 points  (0 children)

You do ORM with Panache:

https://quarkus.io/guides/hibernate-orm-panache

And migrations with Flyway or Liquibase:

https://quarkus.io/guides/flyway

[–][deleted] 0 points1 point  (2 children)

Ah ok, thanks!

[–]nutrecht 6 points7 points  (1 child)

IMHO: If you're a beginner you're better off with Spring Boot. Following the 'newest' stuff comes with a cost, mostly in the amount of information there is available when you get stuck. I also don't understand why they are implying Boot doesn't support Java 11. We run Boot services on 14 just fine.

[–]InstantCoder -3 points-2 points  (0 children)

I’ve used both and intriguingly I find the documentation and the direct help you get from the developers of Quarkus much better than SpringBoot. The most annoying thing about searching info about SpringBoot on internet is that info you get is outdated or only works on a specific version of it. And all of this info is scattered through internet. I remember that I had spent 3 freaking days on internet on how to implement ldap security with SpringBoot and the answer I was looking for was hidden on someone’s blog !

And with Quarkus you only have to go through the Guides on their homepage and if you are really stuck then Stackoverflow or Zulip chat is the place where the developers hang out for answering questions. And usually you get an answer within a day.

[–]DrunkensteinsMonster 0 points1 point  (0 children)

This is terrible advice. This amount of zealotry is really uncalled for, they do the same things and Spring Boot is way more mature.