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 get Java to run Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "can Watch "can New topic
Author

can't get Java to run

Lisa Sams
Greenhorn

Joined: Jul 06, 2005
Posts: 2
I downloaded the SDK and am trying to run my first file. I keep getting the message that 'javac is not recognized as an internal or external command, operable program or batch file'.

my path looks like:
path=c:\windows\system32;c:\windows;c:\windows\system32\wbem;c:\programfiles\java\jre1.5.0_02\bin

if I look at the actual folder name programfiles is actually Program Files (with a space) but my path won't take the space. is this what is causing the problem? Does anyone know how to put a space in the Path?
Rahul Sapkal
Greenhorn

Joined: Jul 06, 2005
Posts: 4
Lisa,
Never had problem giving space in the path. Which OS are you using.
Also JRE is a RunTime Environment, it does not have javac, which is a development/compilation tool. Point your path to the bin directory of the SDK installation, in order to use 'javac'. You can use 'java' and run the compiled Java program using JRE.

Hope this helps,
Rahul
------------
rahul@javareference.com
Niki Nono
Ranch Hand

Joined: Mar 20, 2005
Posts: 256
The bin directory of the sdk installation is normally in the root of c:\ unless you have changed it.
have you insalled the SDK in program files or somewhere else?
You can give the path of program files by following Dos's naming convention which makes it Progra~1.i am sure you are familiar with this.
search for javac in you computer and then put the directory it returns in your path variable.


Life called,so here I am.<br />Cheers<br />Niki.:-)
Lisa Sams
Greenhorn

Joined: Jul 06, 2005
Posts: 2
Niki-

That fixed it. Thanks for the suggestion!
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Alternatively, you can put quotes around a file name containing spaces. I think the following will also fix the problem:

path=c:\windows\system32;c:\windows;c:\windows\system32\wbem;"c:\program files\java\jre1.5.0_02\bin"


Java API Documentation
The Java Tutorial
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Originally posted by Layne Lund:
Alternatively, you can put quotes around a file name containing spaces. I think the following will also fix the problem:

path=c:\windows\system32;c:\windows;c:\windows\system32\wbem;"c:\program files\java\jre1.5.0_02\bin"


But even then, the problem runs a little deeper since the PATH only contains the JRE installation. You probably found out that the JDK is installed else where.

Anyway, feel free to come back with more questions. I hope you enjoy learning Java.

Layne
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can't get Java to run