1. 创建一个maven项目,书写代码.
import java.io.FileOutputStream;
import java.io.IOException;
public class Test {
public void run() throws IOException {
// 根据需求编写具体代码
FileOutputStream fos = new FileOutputStream("/usr/local/azkaban/tasks/output.txt");
fos.write("this is a java progress".getBytes());
fos.close();
}
public static void main(String[] args) throws IOException {
Test azkabanTest = new Test();
azkabanTest.run();
}
}
2. 打开菜单栏File-Project Structure
3. 点击Artifacts
4. 选择启动程序及main()所在的类.
5. 查看生成的META-INF.
6. 点击菜单栏: Build-Artifacts.
7. jar包生成成功.
8. 测试.运行.
java -jar iotestAzkaban.jar