I want to create a shell script which when called run the following command
mvn exec:java -Dexec.mainClass=”location_of_class_file” -Dexec.args=”parameter”;
I want to create a shell script which when called run the following command
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First of all, if you use Maven, you can specify your main class in the pom file. This value will be parsed and will be stored in the manifest file of the jar. So the argument
-Dexec.mainClass="location_of_class_file"can be omitted.If maven (mvn) is in your PATH variable, you can directly paste your command inside
<filename>.shand execute it.You can create the
<filename>.shwithtouch. Remember to give it execute permissions withchmod. E.g. if your filename is let’s say "hui" (that’s a common filename used for testing) it will look like: