<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>thermcampos blog » java</title><link href="http://thermcampos.blog/" rel="alternate"/><link href="http://thermcampos.blog/atom/java/" rel="self"/><id>/atom/java/</id><updated>2026-10-01T18:15:11Z</updated><author><name>R. Campos</name></author><subtitle>Welcome to my blog, personal corner and stuff</subtitle><entry><title>javalin the lightweight java framework</title><link href="http://thermcampos.blog/post/javalin-java-framework/" rel="alternate"/><published>2026-10-01T18:15:11Z</published><updated>2026-10-01T18:15:11Z</updated><author><name>R. Campos</name><email>ricardompcampos@gmail.com</email></author><id>/post/javalin-java-framework/</id><summary type="html">&lt;!-- tags: java --&gt;
&lt;!-- date: 2026-10-01 18:15:11 --&gt;
&lt;p&gt;I'd like to introduce you all to &lt;a class="reference external" href="https://javalin.io/"&gt;Javalin&lt;/a&gt;. Java is known for being heavy and
bloated, verbose, often flagged as bad choice for cold-start functions, or
simple MVPs or POCs. Often because it's slow, or memory-heavy consumer, which
I could agree with, on some situations.&lt;/p&gt;
&lt;p&gt;This is specially interestring if you're coming from languages such as Go or
Typescript and is already familiar with express.js or chi from Golang. The
learning curve for a full Java backend app will be pretty smoth.&lt;/p&gt;
</summary><content type="html">&lt;!-- tags: java --&gt;
&lt;!-- date: 2026-10-01 18:15:11 --&gt;
&lt;p&gt;I'd like to introduce you all to &lt;a class="reference external" href="https://javalin.io/"&gt;Javalin&lt;/a&gt;. Java is known for being heavy and
bloated, verbose, often flagged as bad choice for cold-start functions, or
simple MVPs or POCs. Often because it's slow, or memory-heavy consumer, which
I could agree with, on some situations.&lt;/p&gt;
&lt;p&gt;This is specially interestring if you're coming from languages such as Go or
Typescript and is already familiar with express.js or chi from Golang. The
learning curve for a full Java backend app will be pretty smoth.&lt;/p&gt;
&lt;!-- read_more --&gt;
&lt;p&gt;Let's cut to the chase, no rambling, no time spent. Javalin is simple,
lightweight, interoperable, flexible, supports OpenAPI and runs on
top of Jetty JVM web-server, that includes SSL and HTTP3.&lt;/p&gt;
&lt;p&gt;Here's what a Hello World would look like, if you're curious.&lt;/p&gt;

&lt;pre class="brush: java"&gt;
import io.javalin.Javalin;

void main() {
  var app = Javalin.create(config -&gt; {
    config.routes.get("/", ctx -&gt; ctx.result("Hello World"));
  }).start(7070);
}
&lt;/pre&gt;

&lt;p&gt;And that's it! No &lt;em&gt;annotations&lt;/em&gt; needed, controllers, or any of the boilerplate
that Springs like. As simple as that.&lt;/p&gt;
&lt;p&gt;If you're a &lt;strong&gt;maven&lt;/strong&gt; person, you can get started in the &lt;a class="reference external" href="https://javalin.io/tutorials/maven-setup"&gt;maven-setup page&lt;/a&gt;, but
ify you're a &lt;strong&gt;graddle&lt;/strong&gt; person, use the &lt;a class="reference external" href="https://javalin.io/tutorials/gradle-setup"&gt;graddle-setup page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://javalin.io/tutorials/"&gt;On their page&lt;/a&gt; there's plenty of useful tutorials and code snippets, check it
out. And now if you want to go straight to the code, find their GitHub repo at:
&lt;a class="reference external" href="https://github.com/javalin/javalin"&gt;https://github.com/javalin/javalin&lt;/a&gt;&lt;/p&gt;
&lt;div class="section" id="native-build"&gt;
&lt;h3&gt;Native build&lt;/h3&gt;
&lt;p&gt;Javalin also supports GraalVM. GraalVM builds are OS-native binaries, compiled
into full executable apps that can run without the JVM. This is super attractive
for Serverless and functions that needs cold-start within seconds.&lt;/p&gt;
&lt;p&gt;Here's an example from their main page: &lt;a class="reference external" href="https://javalin.io/2018/09/27/javalin-graalvm-example.html"&gt;https://javalin.io/2018/09/27/javalin-graalvm-example.html&lt;/a&gt;
and if you want something more complete, including tests, Flyway migrations, and more,
you can take a look at this personal project: &lt;a class="reference external" href="https://github.com/thermcampos/lin-order-java"&gt;https://github.com/thermcampos/lin-order-java&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;That's all for today. If you have any questions, I'll be happy to answer. Reach out by using
the comment system below or any of the link in the about page.&lt;/p&gt;
&lt;p&gt;Thanks for reading.&lt;/p&gt;
&lt;/div&gt;
</content></entry></feed>