• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compiler

 
Jeff Te
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to run a simple program but cannot run the compiler. I am running on Vista, and I set the path in the Environment Variables, by copying and pasting the location of my bin folder. I checked the path from the command prompt and it looks correct:

C:\Program Files\JavaFXjavafx-sdk1.2\bin

I wrote a simple program in word pad and when i tried to execute it still got the following error message

javac is not recognized as an internal or external command,
operable program or batch file.

Any help would be greatly appreciated...Thanks!
 
Charbel Keyrouz
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are point to the javafx folder while you should point to the jdk one, supposedely it should be like this:
C:\Program Files\jdk****\bin
 
Jeff Te
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks...I fixed that and checked the path from the prompt and now it displays:

C:\Users\Jeff\Documents\Java\jdk1.6.0_14\bin

However when I tried to run the program I got the following error:

javac: file not found: ExampleProgram.java
Usage: javac <options> <source files>
use -help for a list of possible options
 
fred rosenberger
lowercase baba
Bartender
Posts: 12084
29
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your .java file, and what directory are you running the command from? By default, it looks for the file in the directory you are running the javac command from. in other words, cd into the directory where your .java file is and try again.
 
Jeff Te
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes! Thank you both for your help!
 
Stephen Black
Ranch Hand
Posts: 52
1
Chrome MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just remember that Windows uses the 8.3 naming rules in the dos prompt
Translated into english this means that
C:\Program Files\JavaFXjavafx-sdk1.2\bin
would be represented more like this
C:\Progra~1\JavaFX~1.2\bin

How do I know what the dos name for each file is
Simple at the C:> prompt I type

C:> dir /x
It will then list this file amongst the others Progra~1
Then I type
C:> cd Progra~1
C:\Progra~1> dir /x
JavaFXjavafx-sdk1.2 JavaFX~1.2 Folder
cd JavaFX~1.2
C:\Progra~1\JavaFX~1.2>
Since I know that the bin direcrory only has 3 letters in it's name I type
C:\Progra~1\JavaFX~1.2> cd bin
and then I am in
C:\Progra~1\JavaFX~1.2\bin>


 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15205
36
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't have to worry about the short MS-DOS "8.3" filenames when you're using Windows XP or newer (Windows Vista, Windows 7, ...).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic