栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

Tomcat-UnsupportedClassException

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Tomcat-UnsupportedClassException

这很容易:您使用比Tomcat下面的Java运行时更高的Java编译器来编译应用程序。

更新资料

Java编译器javac支持选项

-source release    Specifies the version of source pre accepted. The following values for release are allowed:    1.3     the compiler does not support assertions, generics, or other language features introduced after JDK 1.3.    1.4     the compiler accepts pre containing assertions, which were introduced in JDK 1.4.    1.5     the compiler accepts pre containing generics and other language features introduced in JDK 5. The compiler defaults to the version 5 behavior if the -source flag is not used.    5   Synonym for 1.5

…甚至更重要的是,

-target version    Generate class files that will work on VMs with the specified version. The default is to generate class files to be compatible with the JDK 5 VM. When the -source 1.4 or lower option is used, the default target is 1.4. The versions supported by javac are:    1.1     Generate class files that will run on VMs in JDK 1.1 and later.    1.2     Generate class files that will run on VMs in JDK 1.2 and later, but will not run on 1.1 VMs.    1.3     Generate class files that will run on VMs in JDK 1.3 and later, but will not run on 1.1 or 1.2 VMs.    1.4     Generate class files that will run on VMs in JDK 1.4 and later, but will not run on 1.1, 1.2 or 1.3 VMs.    1.5     Generate class files that are compatible only with JDK 5 VMs.    5   Synonym for 1.5

…这将允许您为特定版本的JVM编译代码。

换句话说,您可以继续使用1.6编译器,只需向其抛出这些选项,即可使其生成Tomcat能够处理的1.5代码。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/635999.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号