• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can't get Java to run

 
Lisa Sams
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lisa Sams
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Niki-

That fixed it. Thanks for the suggestion!
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic