Results 1 to 4 of 4
- 01-15-2010, 07:44 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 2
- Rep Power
- 0
Ptoblems with eclipse and Scanner
Hey! I'm using Eclipse on Ubuntu for coding Java. My java/javac version is 1.6. and on eclipse the JRE seems to be 1.5.
Eclipse says it cannot resolve Scanner. i have imported it, and i pasted the code to my friends and the got it working without a prob. I ried compile the code from clipse and straight from console but it didn't work. Just complained about the Scanner. here's the code:
import java.util.Scanner;
public class test
{
public static void main(String[] args)
{
int luku;
Scanner scan = new Scanner(System.in);
System.out.println("Anna luku: ");
luku = scan.nextInt();
System.out.println("\n"+luku);
}
}
- 01-16-2010, 11:16 AM #2
Member
- Join Date
- Jan 2010
- Posts
- 14
- Rep Power
- 0
try cleaning the project, ot just restart eclipse
-
You may need to change Eclipse's JDK compliance level. Go to the following menus:
Window
Preferences
Java
Compiler
Then change the Compiler compliance level to 1.6.
- 01-16-2010, 02:23 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,413
- Blog Entries
- 7
- Rep Power
- 17
Be very careful with that: it changes the compliance level of Eclipse's own compiler but if the supplied jre (Sun's stuff) doesn't match that compliance level all bets are off, e.g. if rt.jar doesn't contain a class Scanner the compiler still won't find it.
kind regards,
Jos
Similar Threads
-
Help With Scanner
By jtmoney0511 in forum New To JavaReplies: 10Last Post: 10-12-2009, 11:24 PM -
Need help with scanner.
By mainy in forum New To JavaReplies: 3Last Post: 07-28-2009, 02:11 PM -
Scanner
By choko in forum New To JavaReplies: 10Last Post: 01-24-2009, 03:37 PM -
need help with scanner
By whiterex in forum New To JavaReplies: 1Last Post: 04-22-2008, 01:41 PM -
help with IP scanner
By tommy in forum New To JavaReplies: 1Last Post: 08-06-2007, 08:00 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks