• Post Reply Bookmark Topic Watch Topic
  • New Topic

not compiling java file with $ sign  RSS feed

 
Suketu Patel
Greenhorn
Posts: 23
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI.

This is the simple programme... Nothing in it...


When I compile with code javac Zoo.java it compiles and produced Zoo.class file, But when I try to compile it with $ javac Zoo.java ... compiler give me an error message

'$' is not recognized as an internal or external command, operable programme or batch file.

*** My path is set to C:\Program Files\Java\jdk1.8.0_60\db
*** I've checked in uninstall programs, I do have a copy of Java Development Kit

Please provide me some feedback how to solve this issue..

Thanks.
S B Patel
 
Winston Gutkowski
Bartender
Posts: 10573
65
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
S B Patel wrote:Please provide me some feedback

1. I highly doubt that it's the compiler that's giving you that message.
2. What is that '$' supposed to be?

how to solve this issue..

1. Get rid of the '$'.
2. Explain to us in English what you're trying to do, and we may be able to suggest a solution
- and it certainly won't be "$ javac ...".

Winston
 
Campbell Ritchie
Marshal
Posts: 55772
163
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The PATH looks incorrect. It will not get you through to the Java® executable programs, and it may stop other programs you have from working. The PATH for Java® executables should end bin.
When you look at the command line or a terminal, there is a prompt which might be > or # … or $ on Unix‑like OSs. If you have managed to copy the prompt it will not work. You write javac… without the dollar sign.
 
Campbell Ritchie
Marshal
Posts: 55772
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Liutauras Vilda
Marshal
Posts: 4660
320
BSD
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
S B Patel wrote:But when I try to compile it with $ javac Zoo.java
You might seen $ in some tutorials found on a web and probably it was in Unix type systems context. $ sign in a Unix shell means normal user, some Unix systems denotes it as %, # - means superuser.
As Winston already suggested, just remove $ and you should be fine.
 
Suketu Patel
Greenhorn
Posts: 23
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all for your quick response... Now I got what I was doing wrong, that $ sing I found in a book and author as not specified it with a Linux or any other OS related $ sign... And I thought it might be a another way to compile the Java file.

Once again thank you very much for handle my silly misunderstanding.

Thanks,
S B Patel
 
Campbell Ritchie
Marshal
Posts: 55772
163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Important thing: have you got it to work?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!