0

I would like to make a custom command, which can invoke my java class. I am not sure how to proceed with it.

I don't want to use java < classname> instead I want to create a custom command say mycmd which would run the java class.

3
  • java <classname> won't work ? Commented Sep 16, 2019 at 19:10
  • I don't want to use java <classname> instead I want to use a command say mycmd which would run the java class. Commented Sep 16, 2019 at 19:46
  • Your question is a little vague. Are you using bash? Linux? Windows? etc. Why not just create a bash script? Commented Sep 16, 2019 at 19:48

2 Answers 2

0

Depending upon which OS you're working on, you can always create either batch(.bat for windows) or shell(.sh for unix/linux/mac etc). Pass class name as parameter. Call java command under the script with passed classname.

Sign up to request clarification or add additional context in comments.

Comments

0

Just make a file called mycmd that has a single line with:

java classname

then run the file by typing mycmd at the command line.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.