GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes Could compile but not able to run Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Could compile but not able to run" Watch "Could compile but not able to run" New topic
Author

Could compile but not able to run

Siva kandasamy
Ranch Hand

Joined: Dec 31, 2002
Posts: 139
hi there,
See the code below.
I could able to compile but not able to run.
Getting the following error.
java TestBed$Tester
Tester: Undefined variable
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34


java TestBed$Tester
Tester: Undefined variable

Your shell is trying to expand "$Tester" as a UNIX shell variable. You need to escape the special '$' character with a '\', like
java TestBed\$Tester


[Jess in Action][AskingGoodQuestions]
Siva kandasamy
Ranch Hand

Joined: Dec 31, 2002
Posts: 139
Thank You Ernest.
-siva
 
GeeCON Prague 2014
 
subject: Could compile but not able to run