Using make with java can be an exercise in screwdriving as soon as you have more than one class.
Working Java code will use packages. This way you will have a complex directory tree that reflects the structure of your package, with your .java source files. Writing rules that βseeβ all of these files is a pain.
You must call javac in all source files at the same time to get the correct results. Thus, the usual template βrun one command to turn one source file into one compiled fileβ does not work so well.
However, it seems that your main problem at the moment is that you expect Java to create an executable; a file with a name like "sim". No, this will not happen in a simple way. The java compiler creates .class files; a whole tree of them for your source files. You can run them directly from them, or you can pack them into a JAR file.
To get all the way to something that looks like a simple command line executable, you need to use a more sophisticated tool that wraps it all with a script on the front panel.
Now you just need to do:
java -cp . NAME_OF_THE_CLASS_IN_sim.java
to run after the make file is completed.
source share