Run scala script from shell script -


i have scala project contains both scala classes/objects scripts. trying run scripts (that use classes/objects perform various actions) command line. way looking create shell passed argument name of script, arguments script takes.

my folder structure follows:

runner.sh -> script trying implement run scala scripts bin/ -> script trying implement run scala scripts lib/ -> -> rest of scala project, packed multiple jars  

i creating variable lib_classpath in shell script contains contents of lib/ folder , trying run scrips follows:

java -cp $lib_classpath ./bin/<name_of_script.scala> <parameters of script> 

i same error:

could not find or load main class: ..lib/<name of jar>  -- <name of jar> first jar in lib/ folder 

i use guidance :)

thanks

you can use ammonite (written @lihaoyi).

it's combination of better scala repl, shell, ops library, , script runner. see docs here - http://www.lihaoyi.com/ammonite/

10 min talk showing how better scripting & shell - https://www.youtube.com/watch?v=wk2-zsqu358

i think can starting point well. talk given me :)


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -