【トラブル】【Ant】Eclipse 上で、Ant を使用した際のトラブル

EclipseでAntビルドした際に、エラー「Specified VM install not found」が表示する

エラー内容

Specified VM install not found: type Standard VM, name jreX.X.X_XX

解決方法

1) Eclipse 上の build.xml を右クリックし、[Run As]-[External Tools Configurations...]-[JRE] を選択
 => この時点で、JREタブにエラーアイコンが表示されていた
2) 「Runtime JRE」を自分の環境にあったJREを選択し「Run」ボタン押下

参考文献

http://stackoverflow.com/questions/21296620/specified-vm-install-not-found-type-standard-vm-name-jre7

EclipseでAntビルドした際に、文字化けする

 * Antで実行したら、文字化けする

解決方法

1) Eclipse 上の build.xml を右クリックし、
   [Run As]-[External Tools Configurations...]-[Common]を選択
2) 「Encording」で「MS932」を選択し「Run」ボタン押下

参考文献

http://ameblo.jp/louis1011rui/entry-11307982495.html

■ 警告「No grammar constraints (DTD or XML schema) detected for the document.」が表示される

 * build.xmlで下記の警告内容が表示される。

警告内容

No grammar constraints (DTD or XML schema) detected for the document.

【日本語】
文書に対する文法制約 (DTD または XML スキーマ) が検出されませんでした。

解決方法

* 「<!DOCTYPE configuration>」を追加する
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration><!-- ★ここを追加★ -->
<project basedir="." default="xxx.xxx" name="xxxx">
...
</project>

参考文献

http://d.hatena.ne.jp/penult/20091128/1259416999
http://hascha.blogspot.jp/2012/06/dtd-xml.html

■ Antビルドした際に、警告「'includeantruntime' was not set, ・・・」が表示する

エラー内容

 [javac] C:\...[略]...\build.xml:20: warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds

解決方法

 * build.xml で、「includeantruntime="false"」を追加

build.xml

<javac includeantruntime="false" ...>...</javac>

参考文献

https://teratail.com/questions/2923
http://d.hatena.ne.jp/eggtoothcroc/20100526/p1
http://epian-wiki.appspot.com/wiki/Memo/20100822030535/Ant%201.8%E3%81%8B%E3%82%89%E5%87%BA%E3%82%8BincludeAntRuntime%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E3%83%AF%E3%83%BC%E3%83%8B%E3%83%B3%E3%82%B0