Include a makefile and a very little java project to test it. makejava.mk (and generated makefile) search for a src directory for java files and "java project dirs", auto configure internals of the makefile, if needed, (handled with a shebang to make utility) that permit to build the project classes, run the project and test it (JUnit5 Jupiter).
A makefile that generate a makefile in the current directory, included, build a little java project with a work tree similar to eclipse's (bin, src, test). Handle packages as needed. Also, using tips or imports rules (last one to redirect the output), print imports headers needed on test classes files to use junit jupiter platform. If nedded, download and install junit jupiter platform standalone jar in local project tree.
$ make -f /path/to/makejava/makejava.mk raw
$ make -f /path/to/makejava/makejava.mk configure
Now use make to: build, clear, run and test the project.
$ make build
or
$ make test
or
$ make run
$ make tips
Observe that arguments go before call make but (i.e.) class command go after.
$ classname=Dog packagename=ar.edu.unq.animals make class
will create src/ar/edu/unq/animals/Dog.java
file.
$ classname=CatTest packagename=ar.edu.unq.animals make testclass
will create test/ar/edu/unq/animals/CatTest.java
file.
$ interfacename=IMammal packagename=ar.edu.unq.animals make interface
will create src/ar/edu/unq/animals/IMammal.java
file.
makejava valetuto depends on make and jdk (ie 8/14). You can install thoses packages if needed, i.e.:
# apt install make
# apt install openjdk-8*
or # apt install openjdk-14*