Where is java.util.Scanner?
Hello everyone,
I'm in a java class and I'm trying to do my homework on my linux machine. However, the class Scanner in java.util is nowhere to be found! Can anyone tell me where it could be (or where it could be downloaded)? Thank you |
Hi -
Make sure you have the Sun JDK 1.5: java.util.Scanner wasn't available in 1.4.x or any earlier release: http://java.sun.com/j2se/1.5.0/docs/...l/Scanner.html |
That explains it--I was using 1.4.2.
Thank you |
java.util.Scanner
I can't get this class(java.util.Scanner) to work. I have:
java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode) Got any answers? Thanks! :Pengy: |
tuxhats -
Could you please specify "what's not working"????? |
Hello,
I have the same problem. When I issue java -version I get: Code:
rug@rug-lap:~$ java -version Any help is appreciated. Thanks, vxc |
Ok I did some digging around.
I found out that I have to issue the following to make sure Sun's version of Java is being used instead of GCJ: As root: Code:
update-java-alternatives -s java-1.5.0-sun Code:
/usr/lib/jvm/java-1.5.0-sun Code:
/usr/lib/jvm/java-1.5.0-sun HOWEVER, this didn't really stop the error. Eclipse still says it cannot resolve java.util.Scanner. Thanks again for any help, vxc |
Ok ok I got it to work. On Eclipse, you need to go to Project>Properties then click on the Library tab and add the JRE Library as in /usr/lib/jvm/java-1.5.0-sun/jre.
Hope that helps for anyone who comes down this path. Cheers, vxc |
Oh god thank you so much. You just saved my ass.
|
All times are GMT -5. The time now is 11:42 PM. |