File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes can't compile or run program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic

can't compile or run program

monica mitra

Joined: Jun 16, 2006
Posts: 7
hey I have a problem.I installed JDK 5.0 in my machine.But i can't compile & run my jave programs from command prompt.I can do this by using jbuilder. but i can't do it from commant prompt.plz help me. :roll:
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2398
Did you put the bin directory in your PATH?
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11955

what is the exact error message?

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
bhanushali bhavesh

Joined: Sep 21, 2005
Posts: 3
This is the exact method to run a java code
1] in the command prompt go to the directory where u have saved the program
2] now do a "setpath = "path of the bin folder ( usually it is C:\program Files \Java\jdk1.4\bin) "

3] now do a "javac" , this would compile the program
4] now do a "java programName" , this would run the program
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 46349
Monica Mitra, welcome to the Ranch. Navigate to this site, where you will find installation instructions. Follow them to the letter. The problem you are getting usually means the PATH variable isn't set properly.

Then come back and tell us whether it worked.

monica mitra

Joined: Jun 16, 2006
Posts: 7
I set the path variable but still the error "'javac'is not recoginsed as an internal or external command,operable pragram or batch file" comes each time i try to compile the program.
marc weber

Joined: Aug 31, 2004
Posts: 11343

Please do not post duplicate topics. Please continue this thread here.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
I agree. Here's the link:
subject: can't compile or run program
It's not a secret anymore!