Equivalent of .bat in mac os

前端 未结 3 1793
说谎
说谎 2020-12-24 05:46

I currently use a .bat file that is utilized to invoke a java file. If I wanted to utilize the same functionality on Mac OS what format changes would I make? (u

3条回答
  •  天涯浪人
    2020-12-24 06:12

    The common convention would be to put it in a .sh file that looks like this -

    #!/bin/bash
    java -cp  ".;./supportlibraries/Framework_Core.jar;... etc
    

    Note that '\' become '/'.

    You could execute as

    sh myfile.sh
    

    or set the x bit on the file

    chmod +x myfile.sh
    

    and then just call

    myfile.sh
    

提交回复
热议问题