• 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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 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?
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic