javadoc 时候中文出现错误解决方法
2014-02-27 11:13
393 查看
在java 中提供了生成api doc的工具,使用javadoc 在command中作出api doc文件,具体参数输入javadoc -help查看
在Eclipse 中,选中项目导出,然后选择 doc,然后一直下一步就可以做出来,Eclipse会自动调用jdk的javadoc命令,也可以设置很多虚拟机和javadoc的参数。带有中文注释的一定要加上编码参数,譬如项目使用uft-8编码,做doc就要加上参数-encoding utf-8 -charset utf-8 才能做出doc。
在ant中也自带了javadoc 的命令, 使用参照下面配置
<target name= "javadoc" description ="Generate
the Javadoc HTML pages.">
<delete dir= "${build}/javadoc" />
<mkdir dir= "${build}/javadoc" />
<javadoc destdir= "${build}/javadoc" windowtitle ="Library" use= "yes"
linksource="no" splitindex="yes" encoding= "GBK" docencoding="GBK" >
<classpath>
<fileset dir= "${dist}/lib">
<include name= "*.jar" />
</fileset>
<fileset dir= "${tomcat-root}/lib">
<include name= "*.jar" />
</fileset>
</classpath>
<!-- 需要修改 Begin -->
<packageset dir= "${basedir}/src" defaultexcludes ="yes">
<include name= "org/**" />
</packageset>
<!-- 需要修改 End -->
</javadoc>
</target>
具体文档http://ant.apache.org/manual/Tasks/javadoc.html
在Eclipse 中,选中项目导出,然后选择 doc,然后一直下一步就可以做出来,Eclipse会自动调用jdk的javadoc命令,也可以设置很多虚拟机和javadoc的参数。带有中文注释的一定要加上编码参数,譬如项目使用uft-8编码,做doc就要加上参数-encoding utf-8 -charset utf-8 才能做出doc。
在ant中也自带了javadoc 的命令, 使用参照下面配置
<target name= "javadoc" description ="Generate
the Javadoc HTML pages.">
<delete dir= "${build}/javadoc" />
<mkdir dir= "${build}/javadoc" />
<javadoc destdir= "${build}/javadoc" windowtitle ="Library" use= "yes"
linksource="no" splitindex="yes" encoding= "GBK" docencoding="GBK" >
<classpath>
<fileset dir= "${dist}/lib">
<include name= "*.jar" />
</fileset>
<fileset dir= "${tomcat-root}/lib">
<include name= "*.jar" />
</fileset>
</classpath>
<!-- 需要修改 Begin -->
<packageset dir= "${basedir}/src" defaultexcludes ="yes">
<include name= "org/**" />
</packageset>
<!-- 需要修改 End -->
</javadoc>
</target>
具体文档http://ant.apache.org/manual/Tasks/javadoc.html
相关文章推荐
- tomcat运行时候出现java.net.BindException: Address already in use: JVM_Bind错误解决方法
- 关于AJAX应用的时候,出现open("GET",url,true)错误的解决方法!
- sqlserver还原数据库的时候出现提示无法打开备份设备的解决方法(设备出现错误或设备脱)
- ruby环境sass编译中文出现Syntax error: Invalid GBK character错误解决方法
- android studio 编译的时候出现的错误和解决方法
- python 处理中文时出现的错误'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)" 解决方法
- Ajax $.ajax() 提交数据出现中文乱码的时候解决方法
- python 处理中文时出现的错误'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)" 解决方法
- * Delphi编程时候诡异地出现ORA-00937错误,记录解决它的思路和方法
- ruby环境sass编译中文出现Syntax error: Invalid GBK character错误解决方法
- 织梦eims英文版默认入口是中文和做英文单语出现错误提示的解决方法
- ruby环境sass编译中文出现Syntax error: Invalid GBK character错误解决方法
- 阿里云安装mysql初始化的时候出现如下错误,以及解决方法
- ruby环境sass编译中文出现Syntax error: Invalid GBK character错误解决方法
- sqlserver还原数据库的时候出现提示无法打开备份设备的解决方法(设备出现错误或设备脱)
- 【随笔记录】python 处理中文时出现的错误'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)" 解决方法
- 数据库在创建表语句的时候,出现:列在此处不允许错误的解决方法
- openwrt多线程程序交叉编译时候出现错误解决方法
- ruby环境sass编译中文出现Syntax error: Invalid GBK character错误解决方法
- 运行程序的时候出现内存错误的解决方法