Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Timer wrong constructor?  RSS feed

 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im having problem with this timer:

Jeu.java:22: cannot find symbol
symbol : constructor Timer(int,Jeu)
location: class javax.swing.Timer
minuteur=new Timer(100,this);
^
1 error
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Between this and your other question I think you might be having java issues. Maybe you need to reinstall? Do this for me just for verification.

javac -version

And tell me what it says.
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here goes the result

javac 1.5.0_02
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the class compiles fine for me. I'd say you have issues with your Java install. Try reinstalling maybe?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you compiling? Command line? IDE?
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im downloading javac 1.5.0_03 now
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yet the same problem with java 1.5.0.03
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gregg Bolinger:
How are you compiling? Command line? IDE?


command line
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I am at a loss. It compiles just fine on my PC. Same java version but Windows XP. OS shouldn't matter though.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm guessing you've got a weird CLASSPATH setting, maybe including an old rt.jar file, or perhaps a directory with alternative versions of your own source code.

So what does

% echo $CLASSPATH

say?
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you perhaps defined your own interface named "ActionListener"? Have you copied the Sun source someplace and recompiled it?
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
something

% echo $CLASSPATH
<empty>
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ernest Friedman-Hill:
Have you perhaps defined your own interface named "ActionListener"? Have you copied the Sun source someplace and recompiled it?


its true,
before posting in here i had this


in my source code
but after the first compilation, ive removed it
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ven this doesnt compile
http://java.sun.com/docs/books/tutorial/uiswing/events/example-1dot4/KeyEventDe mo.java
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chitlesh GOORAH:


in my source code
but after the first compilation, ive removed it


Do this then. Delete all .class files and recompile. Make sure you don't have any class files that might reference this old Interface that you had made. I would guess that you still have a class file with your own ActionListener definition somewhere.
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hehe Gregg Bolinger,
you are the man !!
id removed all *.class
now its successfull !!!
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chitlesh GOORAH:
hehe Gregg Bolinger,
you are the man !!




:roll:
 
Chitlesh GOORAH
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hehe you too Ernest Friedman-Hill
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!