2011年11月25日金曜日

[工具使用] Eclipse 设置

1. 设置 debug 或 run 启动参数
项目右键 -> Debug As -> Debug Configurations... -> Arguments
Program Arguments: 命令行参数 (文件名等)
VM Arguments: VM 参数 (-D 等, java --help)

2. 网络设置 (代理)
Menu -> Window -> Preferences General -> Network Connection 的
Active Provider 设置为 Manual, 设定 HTTP, HTTPS, SOCKS proxy 主机名和端口后 OK

就可以 Help -> Install New Software 了

3. 编码方式
3-1. 设置 jsp 等文件模板中 ${encoding} 的默认编码方式
Windows -> Preferences -> Web -> JSP Files
在编码下拉框中选择 UTF-8 即可
同样适用与其他文件 (css, html 等)

3-2. 设置默认打开或保存代码文件的编码方式

3-2-1. 把某一类文件 (jsp) 全部转化为某种编码
Windows -> Preferences -> General -> Content Types
选择所需要更改的文件类型, 在 Default encoding 中输想要的编码 (UTF-8), 按下 Update, 则所有 jsp 文件将被自动转化编码.

3-2-2. 更改工作区的编码 (打开, 读取文件的编码方式)
Windows -> Preferences -> General -> Workspace
在 Text file encoding 中选择 Other, 并输入想要的编码 (这里是 UTF-8), 按确定即可.


4. Tomcat 在控制台上显示乱码

window->preferences->tomcat->tomcatx.x->jdk->optional java VM argume
-Dfile.encoding=SJIS <= 操作系统编码

0 件のコメント:

コメントを投稿