3

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.

4

1 回答 1

2

我没有找到任何解决方案。因此,我使用这个片段:

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
于 2014-11-03T01:57:28.460 回答