File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

can't compile or run program

monica mitra
Greenhorn

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: 2367
Did you put the bin directory in your PATH?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11444
    
  16

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
Greenhorn

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 programName.java" , this would compile the program
4] now do a "java programName" , this would run the program
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39478
    
  28
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.

CR
monica mitra
Greenhorn

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
Sheriff

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
sscce.org
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can't compile or run program