• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

not compiling java file with $ sign

 
Greenhorn
Posts: 23
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 76425
366
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 76425
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
Marshal
Posts: 8410
606
Mac OS X VI Editor BSD Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 76425
366
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Important thing: have you got it to work?
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic