0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Closure Compiler を使ってみた

Posted at

CreateJS を使おうと思ってたんだけど、そういえば FlashDevelop に CreateJS のプロジェクトがあったなぁと試してみたらハマッたので共有。

準備

  1. FlashDevelop をインストールする
  2. FlashDevelop を起動
  3. 「メニュー」→ 「Tools」→「Software Install」→ AppMan を起動
  4. Compilers の Closure Compiler にチェックを入れてインストール
  5. 「メニュー」→ 「Project」→「New Project」→「CreateJS App」

このプロジェクトは Closrue Compiler を使用するらしい。

コンパイルしてみる

プロジェクトの bin の中に プロジェクト名.js ができればおk。
できない場合は大体 Output パネルにエラーが出ている。

Unable to access jarfile

分かり難いけどこんなエラーの場合は原因が二つ考えるので以下を試してみる。

  1. JRE が対応してない可能性があるのでアップデートする。JRE7 以降なら大丈夫そう。
  2. compiler.jar が違う名前でインストールされている可能性があるので名前を変える。「メニュー」→「Tools」→「User Config Files」→「App」→「closure」→「(バージョン)」closure-compiler.jar のような名前が付いた jar ファイルをコピーしてcompiler.jar を作っておく。
  3. FlashDevelop に戻ってもう一度コンパイルしてみる。

エラーが消えていればおk。

蛇足

build.cmd の中を見てみると

Jexec.cmd closure compiler.jar %*%params%

こんな記述がありますが、Jexec.cmd は AppMan がインストールしたプロジェクトを Java で実行するためのやつっぽい。

Jexec.cmd プロジェクト名 実行する.jar [引数]

のように使うらしい。
上のエラーが出て時に、ここの compiler.jar を変更して対処しても良いが毎回変えないといけないので面倒だと思う。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?