compiler problem !

  • (2 Pages)
  • +
  • 1
  • 2

19 Replies - 1719 Views - Last Post: 28 April 2009 - 09:59 PM Rate Topic: -----

#1 nuna  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-January 09

compiler problem !

Posted 03 April 2009 - 01:24 AM

Hi.. I will keep it short!!! my compiler does NOT recognize scanner!!! when I use my code at school it's good but when I use it on my laptop it doesn't work!!! I know that I need scanner.class file but I don't know where to put it or where I can find one!!! :/ GUYS PLEASE the problem is not with the code it's more like with the compiler system.. I need a scanner.class file or advanced compiler!!!!!! can you help me with that ?!!

P.S I posted this as a last resort.. I'm trying to fix this problem for more than a week now and I asked my teacher!!! she wasn't helpful.

thanks

This post has been edited by nuna: 03 April 2009 - 03:12 AM


Is This A Good Question/Topic? 0
  • +

Replies To: compiler problem !

#2 DaneAU  Icon User is offline

  • Great::Southern::Land
  • member icon

Reputation: 286
  • View blog
  • Posts: 1,620
  • Joined: 15-May 08

Re: compiler problem !

Posted 03 April 2009 - 01:33 AM

Does it recognise the command

javac -version ?

If not then look into setting up your environmental variables and paths
Was This Post Helpful? 0
  • +
  • -

#3 searockruz  Icon User is offline

  • D.I.C Regular

Reputation: 24
  • View blog
  • Posts: 460
  • Joined: 07-March 09

Re: compiler problem !

Posted 03 April 2009 - 01:39 AM

can u tell us what errors do ypo get while compiling, so that it will be better for us understanding the problem
Was This Post Helpful? 0
  • +
  • -

#4 nuna  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-January 09

Re: compiler problem !

Posted 03 April 2009 - 01:57 AM

View Postbbq, on 3 Apr, 2009 - 12:33 AM, said:

Does it recognise the command

javac -version ?

If not then look into setting up your environmental variables and paths



The code is find it works!! the problem is when I compile it on my laptop it doesn't recognize scanner !!!

GradeBookTest.java:28: cannot resolve symbol

symbol : class Scanner
location: class GradeBookTest
Scanner inputStream = null;
^
GradeBookTest.java:37: cannot resolve symbol

symbol : class Scanner
location: class GradeBookTest
inputStream = new Scanner(new File("input.txt"));
^
2 errors

Process completed with exit code 1


View Postsearockruz, on 3 Apr, 2009 - 12:39 AM, said:

can u tell us what errors do ypo get while compiling, so that it will be better for us understanding the problem



GradeBookTest.java:28: cannot resolve symbol

symbol : class Scanner
location: class GradeBookTest
Scanner inputStream = null;
^
GradeBookTest.java:37: cannot resolve symbol

symbol : class Scanner
location: class GradeBookTest
inputStream = new Scanner(new File("input.txt"));
^
2 errors

Process completed with exit code 1
Was This Post Helpful? 0
  • +
  • -

#5 searockruz  Icon User is offline

  • D.I.C Regular

Reputation: 24
  • View blog
  • Posts: 460
  • Joined: 07-March 09

Re: compiler problem !

Posted 03 April 2009 - 01:59 AM

well if uou have the scanner class past it besides your program directory

have you added this
import Scanner.*;

i doubt whether this will work as i am really bad in java
Was This Post Helpful? 0
  • +
  • -

#6 nuna  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-January 09

Re: compiler problem !

Posted 03 April 2009 - 02:07 AM

View Postsearockruz, on 3 Apr, 2009 - 12:59 AM, said:

well if uou have the scanner class past it besides your program directory

have you added this
import Scanner.*;

i doubt whether this will work as i am really bad in java



you mean import java.util.Scanner; hoO yessssss I did.
Was This Post Helpful? 0
  • +
  • -

#7 cfoley  Icon User is offline

  • Cabbage
  • member icon

Reputation: 2388
  • View blog
  • Posts: 5,013
  • Joined: 11-December 07

Re: compiler problem !

Posted 03 April 2009 - 02:35 AM

The obvious guesses don't seem to pinpoint the problem. Could you post your code please?
Was This Post Helpful? 0
  • +
  • -

#8 nuna  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-January 09

Re: compiler problem !

Posted 03 April 2009 - 03:10 AM

GUYS PLEASE the problem is not with the code it's more like with the compiler system.. I need a scanner.class file or advanced compiler!!!!!! can you help me with that ?!!
Was This Post Helpful? 0
  • +
  • -

#9 searockruz  Icon User is offline

  • D.I.C Regular

Reputation: 24
  • View blog
  • Posts: 460
  • Joined: 07-March 09

Re: compiler problem !

Posted 03 April 2009 - 03:15 AM

i googled about this topic and found that it is a built in class of java.util
either you are using a old version(not sure whether it exists in old version) or your enviroment varaibles are not proper

do you use a ide?

have you tried compiling other programs?
sorry i am really bad in java(for asking so many questions)
Was This Post Helpful? 0
  • +
  • -

#10 Suitchiro09  Icon User is offline

  • New D.I.C Head

Reputation: -9
  • View blog
  • Posts: 17
  • Joined: 20-March 09

Re: compiler problem !

Posted 03 April 2009 - 03:28 AM

I'm not sure if I could help... I'm just a freshmen IT student who usually learn with my own because some instructors are not reliable in case of questions... This is java programming, right? Scanner is your problem?
I guess, you're jre or jdk may somewhat corrupted... Or if you use ide, it sure not corrupted, it may just have problem on how you code it...
Was This Post Helpful? 0
  • +
  • -

#11 nuna  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-January 09

Re: compiler problem !

Posted 03 April 2009 - 03:37 AM

View Postsearockruz, on 3 Apr, 2009 - 02:15 AM, said:

i googled about this topic and found that it is a built in class of java.util
either you are using a old version(not sure whether it exists in old version) or your enviroment varaibles are not proper

do you use a ide?

have you tried compiling other programs?
sorry i am really bad in java(for asking so many questions)


yeah I'm using an old version !!! where can I download a new one?!!! I use Jcreator pro the newest one but it doesn't work " doesn't recognize scanner "!!! a scanner class is kinda of new class!!
Was This Post Helpful? 0
  • +
  • -

#12 searockruz  Icon User is offline

  • D.I.C Regular

Reputation: 24
  • View blog
  • Posts: 460
  • Joined: 07-March 09

Re: compiler problem !

Posted 03 April 2009 - 03:45 AM

go for netbeans its the best

download it at
http://www.netbeans.org/downloads/

or you can order it for free(free shipping included)
Was This Post Helpful? 0
  • +
  • -

#13 nuna  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-January 09

Re: compiler problem !

Posted 03 April 2009 - 03:47 AM

View PostSuitchiro09, on 3 Apr, 2009 - 02:28 AM, said:

I'm not sure if I could help... I'm just a freshmen IT student who usually learn with my own because some instructors are not reliable in case of questions... This is java programming, right? Scanner is your problem?
I guess, you're jre or jdk may somewhat corrupted... Or if you use ide, it sure not corrupted, it may just have problem on how you code it...



I have j2re1.4.2_16 and jre6 !!! is that what you mean ?!! it's old !! it doesn't support scanner !!!

and I get what you mean by saying " some instructors are not reliable " !!! they're totally not reliable .
Was This Post Helpful? 0
  • +
  • -

#14 searockruz  Icon User is offline

  • D.I.C Regular

Reputation: 24
  • View blog
  • Posts: 460
  • Joined: 07-March 09

Re: compiler problem !

Posted 03 April 2009 - 03:49 AM

i agree with you
they are not reliable because they are not capable of solving your query
Was This Post Helpful? 0
  • +
  • -

#15 nuna  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 08-January 09

Re: compiler problem !

Posted 03 April 2009 - 04:00 AM

View Postsearockruz, on 3 Apr, 2009 - 02:49 AM, said:

i agree with you
they are not reliable because they are not capable of solving your query


yeah tell me about it!!!! and she has phd degree in programing <_< can you believe that!!!! thanks for the link I will try it tomorrow and tell you if it worked or not . I have to study now I have database exam tomorrow!!! wish me luck ;)
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2