Using eclipse JRE 6.0 don't know what's wrong
Error message is as follows : Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Scanner cannot be resolved to a type
Scanner cannot be resolved to a type
import java.util.scanner;
import java.io.*;
public class Areaofasquare2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.print("Hi, This is a program to calculate Area of a Square");
System.out.print("What is the length of the square");
double length = input.nextDouble();
System.out.print("What is the width of the square");
double width= input.nextDouble();
double area= width * length;
System.out.print("The area of the square is");
System.out.println (area);
// TODO Auto-generated method stub
}
Re: Using eclipse JRE 6.0 don't know what's wrong
Have you considered Downloading Java API For eclipse?
Re: Using eclipse JRE 6.0 don't know what's wrong
I Recommend Using Eclipse IDE for Java EE Developers The Download Can Be Fount On Eclipse.org
Its what i use and it's Flawless.
Re: Using eclipse JRE 6.0 don't know what's wrong
Quote:
Originally Posted by
ehren101
Error message is as follows : Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Scanner cannot be resolved to a type
Scanner cannot be resolved to a type
import java.util.scanner;
import java.io.*;
public class Areaofasquare2 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
System.out.print("Hi, This is a program to calculate Area of a Square");
System.out.print("What is the length of the square");
double length = input.nextDouble();
System.out.print("What is the width of the square");
double width= input.nextDouble();
double area= width * length;
System.out.print("The area of the square is");
System.out.println (area);
// TODO Auto-generated method stub
}
It's Scanner not scanner.
Re: Using eclipse JRE 6.0 don't know what's wrong
Changed the scanner to Scanner and it says
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at Areaofasquare2.main(Areaofasquare2.java:8)
Re: Using eclipse JRE 6.0 don't know what's wrong
Your class is unable to compile because there is no compiler to compile the class. JRE!=JDK. JRE is runtime environment but JDK is a development Kit. I am not sure if Eclipse JRE6.0 provides compiler or the development kit.