for Java中的每个循环和泛型 [英] for-each loops and generics in Java EE
本文介绍了for Java中的每个循环和泛型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
但是,它给我的错误如下:
$ b $ ol
for-each循环在源代码1.4中没有使用,尝试使用源代码1.5来启用for-each循环。
在源码1.4中不支持泛型,尝试使用源码1.5来启用泛型
变量方法在源1.4中不受支持
解决方案
选择了错误的JDK - 所有这些功能都是在JDK 1.5中添加的。确保为IDE和Web应用程序App Server选择了1.5 JDK。这应该可以解决您的问题。
I am designing a website-based project wherein I first designed my logical layer in Java SE application development. Then I made the GUI in Java EE for the website. I am importing my Java SE files in the Java EE architecture using JSTL and I will call the data using this only.
But, it is giving me an error as follows:
- for-each loops --
for-each loops are not used in source 1.4, try source 1.5 to enable for-each loop.
- generics --
generics are not supported in source 1.4, try source 1.5 to enable generics
variable-arity methods are not supported in -source 1.4
解决方案
It appears you have the wrong JDK selected - all those features were added in JDK 1.5. Make sure you have the 1.5 JDK selected for both your IDE, and your web application App Server. This should resolve your problem.
这篇关于for Java中的每个循环和泛型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文