I have classic IntelliJ IDEA project (no maven or gradle). I want to transform this project to Makefile project.
For example, I have console application without some frameworks. This application consists of Main.java, Class1.java and Class2.java. The source files are in src/com/site/ folder.
I want to write make in terminal and get Main.jar. Of course, I don't want to create Makefile manually.
I did not find any solution. Therefore, I use this snippet:
someproject -p out
javac src/com/example/*.java -d out/
cd out/ && jar cfe someproject.jar com.example.Main com/example/*.class && mv someproject.jar ../ && cd ..
echo "#!/bin/bash" > someproject
echo 'java -jar $${BASH_SOURCE[0]}.jar' >> someproject
chmod a+x someproject
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With