LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-03-2009, 02:47 PM   #1
charlie0313
Member
 
Registered: Jan 2008
Location: Dunn Loring, VA
Distribution: Slackware 12.0, Ubuntu 8.04
Posts: 47

Rep: Reputation: 15
Java.util.Scanner not found by Eclipse in Ubuntu 8.10


I switched back to Linux again and moved all my java projects onto my Ubuntu system. But when i try and import java.util.Scanner eclipse gives an error and doesn't know what Scanner is. I installed eclipse using apt-get install in Ubuntu. Below is what java -version prints out.

Code:
charlie@charlie-laptop:~$ java -version
java version "1.6.0_0"
IcedTea6 1.3.1 (6b12-0ubuntu6) Runtime Environment (build 1.6.0_0-b12)
OpenJDK Server VM (build 1.6.0_0-b12, mixed mode)
Let me know if I need to give more info. Any suggestions would be great. Thanks
 
Old 01-03-2009, 04:11 PM   #2
Mega Man X
LQ Guru
 
Registered: Apr 2003
Location: ~
Distribution: Ubuntu, FreeBSD, Solaris, DSL
Posts: 5,339

Rep: Reputation: 65
Quote:
Originally Posted by charlie0313 View Post
I switched back to Linux again and moved all my java projects onto my Ubuntu system. But when i try and import java.util.Scanner eclipse gives an error and doesn't know what Scanner is. I installed eclipse using apt-get install in Ubuntu. Below is what java -version prints out.

Code:
charlie@charlie-laptop:~$ java -version
java version "1.6.0_0"
IcedTea6 1.3.1 (6b12-0ubuntu6) Runtime Environment (build 1.6.0_0-b12)
OpenJDK Server VM (build 1.6.0_0-b12, mixed mode)
Let me know if I need to give more info. Any suggestions would be great. Thanks
Hi charlie0313,

The first thing I would look at is if your project is using the correct JDK. To do so, right-click on your project, then Properties > Java Compiler and make sure the JDK compliance is set correctly/and or specify a new one.

Remember that the Scanner class was added at Java 5, so if you are trying to build it with Java 1.4.x it won't work. If everything looks fine there, it may be a problem with the Eclipse you were using on your previous OS to the one you are using with Ubuntu.
I am not sure which Eclipse version is available on Ubuntu repositories, but I would recommend you to go to www.eclipse.org and grab the latest one. It is just a zip file, so it does not require any installation and it won't interfere with your current installed Eclipse.

My last suggestion would be to create a new workspace and import your projects once again to see how it goes. Sometimes, my workspace gets messed up for some reason
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is java.util.Scanner? pda_h4x0r Programming 8 11-12-2007 03:53 PM
java: java.util.Hashmap doesn't work for a custom object kpachopoulos Programming 2 04-15-2007 03:25 PM
Help!: Installing Eclipse and Java on UBUNTU 6.10 h3x0r Linux - Software 1 03-15-2007 03:37 PM
java.util.*; in Linux? vmlinuz.gz Programming 3 04-05-2006 02:26 PM
Java can't find package, but PATH set correctly (j2se1.4.0, java.util.regex package) Ethan Programming 5 02-06-2004 09:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration