• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Error compiling program in NetBeans

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm in the process of migrating my struts-based web application to a project in NetBeans5.5 and when I try and compile my code, I get the following error:
C:\Java Code\Struts\ProjectX.1\src\com\product\dao\EmployeeDAOMySQLImp.java:380: for-each loops are not supported in -source 1.4

(try -source 1.5 to enable for-each loops)
for (String token:result) {


I'm not sure what that means or where to change this. Is this related to my JDK version? When I look at my NetBeans configuration, I am using the JDK 1.5 default. Prior to migrating to NetBeans5.5, I wrote and compiled everything manually without any issues.

Does anyone have any ideas or recommend any resources to get me past this error?

Thanks in advance.
Scott
 
Scott Updike
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd like to follow up with more information. When I go to Project Properties (by right clicking on the Libraries folder) and select the 'Run' category, I see the following:

Server: Bundled Tomcat 5.5.17
JavaEE Version: J2EE 1.4

Could the Java EE version be my issue?
 
All of the following truths are shameless lies. But what about this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!