bash - Where to put files for a command-line Java program? -


i have written java program takes in arguments , executes. pass in these arguments command line (i on macbook pro using terminal, using bash shell). let's name of program prgm. want able "prgm " directory in shell , have program execute. figure need write bash script reference java files , take in arguments, , put bash script somewhere in path. put bash file, , put java files? also, right assume need .class (binary) java files?

step-by-step:

  1. assuming name of java executable if myjavaprog.
  2. assuming name of bash script myscript.
  3. make sure myscript calling myjavaprog using absolute path , desired arguments.
  4. call echo $path , see bunch of paths: /some/path1:/some/other/path2:...
  5. put bash script in whatever path want ones returned echo $path.
  6. go random path.
  7. call bash script bash myscript. see execution of myjavaprog.

tips:

  • if java program personal use only, put in path starting /usr/ or in $home directory (and add location path)
  • if java program must shared other users, put in accessible place, other users don't need modify path variable.

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -