10
10

More than 5 years have passed since last update.

WindowsのAtomでGroovyを実行する

Last updated at Posted at 2014-12-05

簡単なスクリプトをGroovyで書いて、実行するのに、これまでGroovyConsoleを使ってたんだけど、Atomでも実行できたのでメモ。

必要なパッケージを入れる

これだけで、groovyにパスが通っていれば Ctrl+Shift+b するとGroovyを実行できる。でも、これだけだと標準出力が文字化けする。

Windowsの設定を変更

以下を、Windowsのユーザー変数として環境変数に設定する。

  • Groovyにパスを通す(通してなければ)
    • 自分の場合、GVMでインストールしてるので C:\Users\hoge.gvm\groovy\2.3.7\bin をPathに追加
  • JAVA_OPTSを設定して標準出力の文字化けを防ぐ
    • JAVA_OPTSに -Dgroovy.source.encoding=UTF-8 -Dfile.encoding=UTF-8 を設定

注意

Cygwinから atom . で開くと、JAVA_HOMEがcygdrive以下になって動かなかったりする。
エクスプローラーからOpen with Atomしたり、Atomからフォルダを開く必要あり。

参考URL

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10