Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse Refuses to Compile Simple Program(Compiling Problem)
icon8.gif  Eclipse Refuses to Compile Simple Program [message #1464752] Fri, 07 November 2014 21:08 Go to next message
John Myers is currently offline John MyersFriend
Messages: 2
Registered: November 2014
Junior Member
I am brand new to Java programming. I've been watching a tutorial on Udemy and I am trying to create a simple program that the instructor programmed himself. I copied the code verbatim, but I keep getting errors. I've changed so many things but get the same result. I deleted and recreated the class file as well as the project. I closed and reopened Eclipse. Just makes no sense. I understand what most of the errors are telling me, but this code is the same as what the instructor is running. Here is my code:

public class App {

public static void main(String[] args) {
For (int i=5; i <= 10; i++) {
System.out.println("The value equals: " + i);
}

}

}



Here are the errors:
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method For(Class<Integer>) is undefined for the type Application
Syntax error, insert ". class" to complete Expression
Syntax error, insert ")" to complete MethodInvocation
Syntax error, insert ";" to complete BlockStatements
i cannot be resolved to a variable
i cannot be resolved to a variable
Syntax error on token "<", invalid AssignmentOperator
i cannot be resolved to a variable
Syntax error on token ")", ; expected
i cannot be resolved to a variable

at Application.main(Application.java:5)
Re: Eclipse Refuses to Compile Simple Program [message #1464780 is a reply to message #1464752] Fri, 07 November 2014 21:38 Go to previous message
John Myers is currently offline John MyersFriend
Messages: 2
Registered: November 2014
Junior Member
Wow, okay so I figured it out. I had the word 'For' capitalized but it should be lowercase, for.
Previous Topic:Using JRE 1.8 settings, but JRE remains at 1.4 with compliance 1.7
Next Topic:Help with Java -issue
Goto Forum:
  


Current Time: Fri May 10 22:10:07 GMT 2024

Powered by FUDForum. Page generated in 0.03101 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top