MacMusic  |  PcMusic  |  440 Software  |  440 Forums  |  440TV  |  Zicos
java
Search

The best Java and JVM language frameworks

Wednesday March 5, 2025. 10:00 AM , from InfoWorld
Not long ago in this space, we compared the 10 best front-end JavaScript frameworks. Now we turn our piercing gaze to the ample supply of back-end frameworks, starting with frameworks built for Java and JVM languages. Learn about your options for static site generation (SSG) and developing and working with APIs in one of the world’s most secure, capable, and vast software development ecosystems: the Java virtual machine.

The best frameworks for Java

Java is one of the seven wonders of the programming world. In recent years, it has struck an admirable balance between innovation and stability by incorporating both functional and reactive elements. It boasts a sprawling, active ecosystem and first-class security, performance, and concurrency. Probably the most common critique of Java is that its syntax can be clunky when compared with newer languages. Rivals include JVM languages like Kotlin, which I’ve been experimenting with lately.

When evaluating back-end frameworks for Java, base your decision on what your project needs. All the frameworks included here do something well, and some of them—especially Spring—do many things very well. Comparing their features side by side should help you narrow down your choice.

If you are a Java developer, you owe it to yourself to at least look at other JVM languages like Kotlin and Scala. But Java is a familiar choice for many developers, and it’s more than capable of doing whatever you need. Here’s a look at how the top back-end frameworks for Java and JVM languages compare based on key features (3 is the highest rating in this chart).

FrameworkAPIRealtimeSSGUnique strengthsSpring322Enterprise versatilityMicronaut321Cloud-native, microservicesQuarkus321Cloud-native, developer experienceJHipster321Full-stack SSGKtor/Kotlin322Kotlin-centric, flexiblePlay/Scala332Reactive, Scala, high-performanceVert.x331Reactive, event-driven 7 Java and JVM language frameworks compared.

My evaluations here are, of course, highly subjective. Notice I’ve given all these frameworks my top rating for API support. If you want to build endpoints, every framework on this list hits the ball out of the park. Then it’s just a question of what style meets your goals based on other factors like developer experience (DX) and any pre-existing technology investments.

Let’s take a closer look.

Spring Framework

Spring is the definitive back-end framework for Java. It introduced the concepts of inversion of control and dependency injection, which developers today take for granted. Modern Spring has made huge strides in simplification, particularly with Spring Boot. On the web development side, Spring MVC and REST together can handle most anything you throw at them. Compared with a JavaScript framework like Express, Spring is big on formality. Its strength is enterprise development.

In this example, we use Spring’s dependency injection mechanism to inject a service. The service provides data for a /hello route, then does some work with it for the response:

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class GreetingController {

@Autowired
private GreetingService greetingService;

@GetMapping('/hello')
public String hello() {
String greeting = greetingService.getGreeting();
return greeting.toUpperCase();
}
}

Micronaut

Micronaut is a relatively new Java framework, tailored to lightweight microservices APIs. If you are a Java-based developer looking for a performant, non-blocking API framework, Micronaut has you covered.

Micronaut looks a lot like Spring for routes, but it has different tricks up its sleeve. This example highlights Micronaut’s ahead-of-time (AOT) compilation for fast startups:

import io.micronaut.http.MediaType;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;
import io.micronaut.http.annotation.Produces;

@Controller('/hello')
public class HelloController {

@Get(produces = MediaType.TEXT_PLAIN)
public String index() {
return 'Hello, InfoWorld from Micronaut!';
}
}

Quarkus

Like Micronaut, Quarkus focuses on cloud-native development. Quarkus is more of an opinionated-style framework, with strong command-line interface (CLI) support for devmode and container-aware packaging. One of Quarkus’ strengths is in streamlining and empowering the command-line experience. Here, we use it to create a new application and run it in hot-swap devmode:

# New Quarkus project with the RESTEasy extension
mvn io.quarkus.platform:quarkus-maven-plugin:2.16.0.Final:create
-DprojectGroupId=org.acme
-DprojectArtifactId=my-quarkus-app
-Dextensions='resteasy'

cd my-quarkus-app

# Run the application in dev mode./mvnw compile quarkus:dev

--
Tests paused
Press [e] to edit command line args (currently ''), [r] to resume testing, [o] Toggle test output, [:] for the terminal, [h] for more options>

JHipster

JHipster is possibly the most expansive and ambitious framework on this list. It covers an enormous range of flexibility including both SQL and NoSQL back-end datastores, all within the Java and JVM ecosystem.

Notice how seamlessly the JHipster generator wizard ties together a wide range of technologies in one cohesive framework:

✔ What is the base name of your application? jhip
✔ Which *type* of application would you like to create? Monolithic application (recommended for simple projects)
✔ What is your default Java package name? com.infoworld
✔ Would you like to use Maven or Gradle for building the backend? Gradle
✔ Do you want to make it reactive with Spring WebFlux? no
✔ Which *type* of authentication would you like to use? JWT authentication (stateless, with a token)
✔ Besides JUnit, which testing frameworks would you like to use?
✔ Which *type* of database would you like to use? MongoDB
✔ Which cache do you want to use? (Spring cache abstraction) Ehcache (local cache, for a single node)
✔ Which other technologies would you like to use? Elasticsearch as search engine
✔ Do you want to enable Gradle Enterprise integration? no? Which *framework* would you like to use for the client?
Angular
❯ React
Vue
No client

The best frameworks for JVM languages

The JVM provides a stable, performant, and secure platform for basically any language and purpose, not just Java. The programming world has responded to this opportunity by producing many excellent frameworks and languages for the JVM. Here are a few of the best.

Kotlin/Ktor

For Java developers looking to expand their horizons, Kotlin is a clear choice. It rounds off some of the sharp corners of Java while retaining much of its structural robustness. Kotlin supports several runtimes including the JVM.

Kotlin works well with Spring, but its native framework is Ktor, which shines by offering a developer experience similar to Ruby on Rails. Ktor’s configuration and setup fall into the more flexible category but also require more hands-on configuration. The following example highlights Kotlin’s HTML DSL for templating:

routing {
get('/') {
call.respondHtml {
head {
title('Quotes')
}
body {
h1 { +'Quotes to Live By' }
ul {
listOf(
'This Mind is the matrix of all matter.' to 'Max Planck',
'All religions, arts and sciences are branches of the same tree.' to 'Albert Einstein',
'The mind is everything. What you think you become.' to 'Buddha'
).forEach { (quote, author) ->
li {
p { +quote }
p { +'― $author' }
}
}
}

Producing the HTML requires nothing beyond Kotlin itself.

Intro to Kotlin with Ktor
Learn more about Kotlin with Ktor from my two recent articles introducing Ktor as an HTTP server and exploring its server-side capabilities.

Scala/Play

Scala is a JVM language best known for its high-performance, functional programming style. Scala excels at non-blocking, asynchronous operations. Using it can be an adjustment if you’re coming from a largely imperative and/or object-oriented background. Scala also emphasizes immutability.

The Scala/Play stack is best known for high-throughput, reactive-style microservices and middleware. Play is like a layer of HTTP semantics over Scala’s functional programming engine. Play strives to keep you in the mode of connecting reactive event streams. Combined with the scala build tool, Play is a nicely integrated, intelligent platform for developing rock-solid back ends. It’s especially well-suited for real-time systems.

Here, we’re defining a simple “Hello, World” endpoint in Scala and Play:

import play.api.mvc._
import javax.inject._

@Singleton class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {
def index = Action {
Ok('Hello, InfoWorld!')
}
}

Vert.x

One of the first reactive projects in the JVM ecosystem, Vert.x is a polyglot project extraordinaire. As of this writing, Vert.x supports at least eight languages that run in the JVM, including Java, JavaScript, Ruby, Groovy, Scala, Kotlin, and PHP. The most popular options are Java and Kotlin.

Vert.x is now in major release 4.5.13, and Vert.x 5.0.0 is in candidate releases and should drop soon. It is an Eclipse Foundation project with an open-source ethos and a large, active community. You can also use Vert.x as a multi-language event bus, something like Java’s JMS.

Vert.x is a complete multi-process, event-driven engine that can scale to multi-core servers out of the box (what it calls the multi-reactor architecture). In essence, Vert.x gives you all the primitives for building high-throughput, reactive-style pipelines with the app server semantics layered on top.

Here’s a simple example of providing an endpoint using Vert.x with Java:

@Override
public void start(Promise startPromise) throws Exception {
vertx.createHttpServer().requestHandler(req -> {
req.response().putHeader('content-type', 'text/plain').end('Hello from Vert.x!');
}).listen(8888).onComplete(http -> {
if (http.succeeded()) {
startPromise.complete();
System.out.println('HTTP server started on port 8888');
} else {
startPromise.fail(http.cause());
}
});
}
}

Notice the use of functional handlers for the request and server startup. Vert.x’s basic style is using chained functional event handlers. You can also use it for a whole range of higher-order reactive powers like reactive composition, backpressure, and error handling.

Conclusion

Given how stable and long-lived the Java platform is, it’s no surprise that the Java language and its cousins have produced so many high-quality frameworks. For developers who already know and love Java, it’s worth exploring other languages and frameworks in the JVM ecosystem. Knowing the strengths of a variety of JVM languages and frameworks gives you options. For developers newer to Java, you have your pick of the crop, with powerful options aplenty.
https://www.infoworld.com/article/3836016/the-best-java-and-jvm-language-frameworks.html

Related News

News copyright owned by their original publishers | Copyright © 2004 - 2025 Zicos / 440Network
Current Date
Mar, Mon 10 - 14:03 CET