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.

2 Answers2

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.

Raman Shrivastava
  • 2,923
  • 15
  • 26
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.

LowKeyEnergy
  • 652
  • 4
  • 11