aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Error compiling program in NetBeans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Error compiling program in NetBeans" Watch "Error compiling program in NetBeans" New topic
Author

Error compiling program in NetBeans

Scott Updike
Ranch Hand

Joined: Feb 16, 2006
Posts: 92
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

Joined: Feb 16, 2006
Posts: 92
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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Error compiling program in NetBeans