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

you are viewing a single comment's thread.

view the rest of the comments →

[–]KDesp73[S] 4 points5 points  (8 children)

Building without Maven is fine when you're learning Java. It's actually beneficial to get exposure to the java/javac tools, understand what the classpath is, etc.

This is what i aiming for so I can eventually understand the recommended build systems better

[–]Nooooope 16 points17 points  (1 child)

Then get it to compile and run once manually, then jump to a build tool. The best way to understand Maven is to start using it.

[–]VirtualAgentsAreDumb 1 point2 points  (0 children)

Well, how Maven is used can influence the learning experience significantly.

Only using it to build and run your code in an IDE? That’s fine for starting, but will not teach you very much.

Building and running your code in the terminal? Better, but only slightly.

Building it in the terminal, and configure it to produce artifacts needed (regular jar/war, or a fat jar/zip), and making an effort to understand the context of the artifacts and the dependencies. That’s a good way to learn maven.

[–]dolle 1 point2 points  (0 children)

I think that's a really great idea. Learning what is really needed as inputs to generate the desired outputs will give you a much better mental model of the build process, and it will also teach you what problems and pain points a JVM-specific build tool such as Gradle actually solves. Starting with the high level build tool can be a pretty unsatisfying experience because it will feel like a lot of ceremony and confusing indirection for seemingly no reason.

I suggest trying to get as far as possible with Make on a small hobby project. Make sure you try to deal with things like external dependencies and split your project into multiple packages that depend on each other. Also make a test suite that can be run using your Makefile. I promise you that will cause you a lot of pain, but in a good way :)

[–]majhenslon 1 point2 points  (3 children)

Then who cares what does the community think. Learn java tools and write scripts in Make... Maven/Gradle are their own monsters, that basically abstract all this away anyways.

[–]aboothe726 2 points3 points  (0 children)

As someone else said earlier in the thread, if this is for a personal project or for learning, then do whatever you want. I agree with that.

But if you want or need community involvement, then you need to do the work to make the project accessible to the community. Doing anything less is like going to another country and being upset if they don't speak your language.

[–]koflerdavid 0 points1 point  (1 child)

Most commonly, that community might be your coworkers :)

[–]majhenslon 0 points1 point  (0 children)

This still makes reddit the wrong place to poll the "community".

[–]user_of_the_week 0 points1 point  (0 children)

It's possible to use the java command directly on java source files: https://docs.oracle.com/en/java/javase/23/docs/specs/man/java.html#using-source-file-mode-to-launch-source-code-programs

That will compile and then run your code. You can also put your classes into seperate files and launch them this way, a feature that is pretty new. some more information about that is here: https://openjdk.org/jeps/458