Skip to main content
Became Hot Network Question
Prettify hint
Source Link
Toby Speight
  • 88.7k
  • 14
  • 104
  • 327
cd "$(dirname "$0")"
javac -d . -sourcepath Source Source/project/Main.java
rm "Project.jar" 2>"/dev/null"
jar cfm "Project.jar" "Manifest.txt" project/*
cd "$(dirname "$0")"
javac -d . -sourcepath Source Source/project/Main.java
rm "Project.jar" 2>"/dev/null"
jar cfm "Project.jar" "Manifest.txt" project/*

This script would be placed in a Project directory, in which is Manifest.txt and a Source directory which contains the base package, i.e., Main.java would start with package project;. The script would compile the Java into classes, creating a directory of name project inside the Project directory, and then from the class files create Project.jar. I do not have any IDEs installed, but is this typically how they work to compile a project with multiple .java files into a single .jar file?

cd "$(dirname "$0")"
javac -d . -sourcepath Source Source/project/Main.java
rm "Project.jar" 2>"/dev/null"
jar cfm "Project.jar" "Manifest.txt" project/*

This script would be placed in a Project directory, in which is Manifest.txt and a Source directory which contains the base package, i.e., Main.java would start with package project;. The script would compile the Java into classes, creating a directory of name project inside the Project directory, and then from the class files create Project.jar. I do not have any IDEs installed, but is this typically how they work to compile a project with multiple .java files into a single .jar file?

cd "$(dirname "$0")"
javac -d . -sourcepath Source Source/project/Main.java
rm "Project.jar" 2>"/dev/null"
jar cfm "Project.jar" "Manifest.txt" project/*

This script would be placed in a Project directory, in which is Manifest.txt and a Source directory which contains the base package, i.e., Main.java would start with package project;. The script would compile the Java into classes, creating a directory of name project inside the Project directory, and then from the class files create Project.jar. I do not have any IDEs installed, but is this typically how they work to compile a project with multiple .java files into a single .jar file?

Source Link
CPlus
  • 1.5k
  • 7
  • 28

Shell script to compile Java

cd "$(dirname "$0")"
javac -d . -sourcepath Source Source/project/Main.java
rm "Project.jar" 2>"/dev/null"
jar cfm "Project.jar" "Manifest.txt" project/*

This script would be placed in a Project directory, in which is Manifest.txt and a Source directory which contains the base package, i.e., Main.java would start with package project;. The script would compile the Java into classes, creating a directory of name project inside the Project directory, and then from the class files create Project.jar. I do not have any IDEs installed, but is this typically how they work to compile a project with multiple .java files into a single .jar file?