[SOLVED] Simple Makefile for java program


This Content is from Stack Overflow. Question asked by Neoguru

Trying to create a Makefile for my java program in intelliJ. It is a file with 2 classes Opcode and my Main my opcode is setup to extend from my main and I have them both in my SRC folder. But when I try and run them and run the makefile it can never find the path.

$PATH: src/Main.java
    javac Main.java
    java Main

Is what I have now any suggestions on how to fix this?


You’re better of using some tool for that ecosystem like gradle or maven. Using makefiles is not common except for c/c++ parts using JNI.

This Question was asked in StackOverflow by Neoguru and Answered by puucee It is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?