himorogiの日記

主にプログラミングに関することなど。少々ハード(電子工作)についても。

Mac OS X で Mozilla Rhino を使うための設定

Rhino をインストール:詳細省略

 適当な場所(今回は user home に RhinoHome ディレクトリを作った)に、rhino(今回は rhino1_7R1)を展開する

Rhino の起動を簡素化する

 pico エディタで .bash_profile を編集する

  pico ~/.bash_profile

 パスを通し、rhino 起動スクリプトを alias として短縮するために .bash_profile に追加する内容

  export CLASSPATH=~/RhinoHome/rhino1_7R1/js.jar
  alias rhino="java org.mozilla.javascript.tools.shell.Main" 

 .bash_profile を反映させる

  source ~/.bash_profile