PDA

View Full Version : Eclipse and OS X and import java.util.Scanner




prostuff1
Apr 4, 2006, 06:20 PM
I have just started my CS&E classes. Now we use windows and that is fine with me but i really dont want to have to go to the labs to do all my CS&E homework. I have installed the Java 1.5 stuff and did the terminal stuff to get it as the defualt java for everything. I followed the instrucation on this site (http://www.justinbellmor.com/2005/08/24/how-to-use-java-15-as-your-default-java-in-tiger/).

I am using the import java.util.Scanner and i keep getting a message that says java.util.Scanner cannot be resolved.

Please help me out so i dont have to spend much amount of time sitting in craptastic chairs in the labs.

Thanks



Heath
Apr 4, 2006, 07:02 PM
If you open up a terminal and type

java -version

what is your output?

ryan
Apr 4, 2006, 07:09 PM
Is the Compiler compliance level in Eclipse set to 5.0? You can check this by going into the project properties (option+Enter) -> Java Compiler -> JDK Compliance.

prostuff1
Apr 4, 2006, 07:31 PM
If you open up a terminal and type

java -version

what is your output?

when i run that command in terminal i get this
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-83)
Java HotSpot(TM) Client VM (build 1.5.0_05-48, mixed mode, sharing)


And:
Is the Compiler compliance level in Eclipse set to 5.0? You can check this by going into the project properties (option+Enter) -> Java Compiler -> JDK Compliance.

This was it i think... It now tell me that it is not used instead of not being able to be found. I had selected it when i first started the project but for some reason it wanted me to select it there instead of at startup.

Thanks so much and everything seems to be fixed now.