直接在build.properties视图下添加一行:
-
javacDefaultEncoding.. = UTF-8
-
source.. = src/
-
output.. = bin/
-
bin.includes = plugin.xml,\
-
META-INF/,\
-
.,\
-
icons/,\
-
product_lg.gif,\
-
splash.bmp,\
-
libs/commons-io-2.4.jar,\
-
libs/commons-lang3-3.3.2.jar
-
source.. = src/
-
src.excludes = icons/Thumbs.db
-
src.includes = icons/,\
-
splash.bmp,\
-
product_lg.gif,\
-
src/log4j.properties
-
javacDefaultEncoding.. = UTF-8
第二种方法
1.右键单击build.properites文件,"PDE tools" -->" Create Ant Build File"
2.打开生成的build.xml文件,在javac中增加属性encoding="utf-8"
3.打开build.properties文件,浏览"Build"页面,勾选中"Custom Build"(网上的文章,把这一步放到了最前面。但实际上,默认是不勾的,也没build.xml文件,如果先勾上,是无法生成build.xml文件的)
-
找到如下标签:
-
<!-- compile the source code -->
-
<javac destdir="${build.result.folder}/@dot" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}" >
-
-
修改为:
-
<!-- compile the source code -->
-
<javac destdir="${build.result.folder}/@dot" failonerror="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bundleBootClasspath}" source="${bundleJavacSource}" target="${bundleJavacTarget}" encoding="UTF-8" >
阅读(1061) | 评论(0) | 转发(0) |