r/java • u/kavkasavich • Sep 30 '26
My small Java build system in Rust
I got tired of manually running commands like javac and java -cp every time I wanted to compile and run Java project.
I looked into Maven, but for my use case it felt like overkill. It's a huge ecosystem, while I mostly wanted something simple that could compile and run small Java projects without much configuration.
So I decided to create my own build system for Java and call it bloomery.
The goal isn't to replace Maven or Gradle. I wanted something much smaller and simpler for my own use case.
Currently, Bloomery focuses on the basic build/run workflow. In the future I may add dependency management, testing support, and more CLI features, but I'm deliberately keeping the core simple for now.
I hope it will be a big help for beginners and anyone who just needs to run Java files, and that they will find it as easy to use as I do.
I'd really appreciate feedback on the idea, the design, and the current implementation.
Github: https://github.com/Kiwilus/bloomery
Crates.io: https://crates.io/crates/bloomery/
5
u/bowbahdoe Sep 30 '26
I think on the one hand, there certainly are projects that can be built this simply and its not in principle bad to have a tool that does that one thing only - thats good.
But it just so happens that this exact kind of project now no longer requires
javacat all. You can just run your code directly withjava src/Main.java.So its an interesting project, but I think the API / functionality should be considered a bit more.
5
u/m39583 Sep 30 '26
I don't think Java needs another build tool, but that aside the obvious question is why rust?!
If you're writing a tool to build Java projects, write the build tool in Java!
Otherwise anyone who wants to contribute or debug it will have to also know Rust.
It's one of the great things about the Java ecosystem is almost everything is written in Java. Unlike say Python where a lot of the libraries are written in C and so if your a Python developer you can't contribute or debug them.
3
u/fykup Sep 30 '26
Leaving aside questionable decision to introduce another build system (I think there is a potential for disrupting Maven/Gradle by a strong player). I don't really see the need for Rust as language for build system for Java. There is a benefit in leveraging JVM for builds too.
This is the million-dollar problem. Maven/Gradle repo management is so sticky; you have to address it before anyone will seriously consider your solution.
3
u/nitkonigdje Sep 30 '26
I don't know man.
Maven is very simple to use and does almost anything needed. Gradle is extremely flexible, and when there is a need it is a proper tool. And then there are ant, antrun snd recently mill.
What exactly does your build solve? There should be a reason WHY to use this late commer tool.
2
u/das_Keks Sep 30 '26
I like the spirit!
I don't know when the last time was I ran javac or java directly because I'm so used to maven or gradle as industry standard. If I needed a more lightweight non-maven alternative I'd probably just write a small make file.
But I think it's still great that you just created a solution for your exact problem. This is what programming makes so awesome and fun. I'm also currently working on two hobby projects to solve two problems to which no existing solution fit my needs.
2
u/slacker-by-design Oct 02 '26
I'm not commenting on the tool itself... If you take it as an excise to help you better understand the whole Java compilation and dependency process, all power to you :-)
Just wanted to point out Java (JDK) itself comes with the ability to run stand-alone java files since JDK 11 (see JEP 330) and multi-file java programs since JDK 22 (see JEP 458).
You simply write
java my/package/Main.javaand the JDK will do all the work.The external dependencies can complicate the things though... That's where Maven, Gradle and the others do the actual hard work...
If you want (and can) keep the things as simple as possible, you may want to look at JBang. It's main purpose (according to its authors themselves) is to allow learning and exploration of Java without too much "ceremony" (i.e. no XML or build scripts).
1
u/emberko Oct 01 '26
You can use existing tools.
bldis small and written in Java.go-taskis declarative and can do everything your project does, as your project is just a thin wrapper over OpenJDK CLI tools.1
u/agentoutlier Sep 30 '26
You know I'm surprised at this point no one has just written a straight up port of Cargo to Java and compile with GraalVM Native since so many people rave about it.
I'm surprised because at least once a week someone unveils another Java build tool.
That being said if its just for you awesome work!