aspose file tools*
The moose likes Beginning Java and the fly likes Compiler Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Compiler" Watch "Compiler" New topic
Author

Compiler

Jeff Te
Greenhorn

Joined: Aug 11, 2009
Posts: 18
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

Joined: Jun 10, 2005
Posts: 46
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

Joined: Aug 11, 2009
Posts: 18
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

Joined: Oct 02, 2003
Posts: 11422
    
  16

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.


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

Joined: Aug 11, 2009
Posts: 18
Yes! Thank you both for your help!
Stephen Black
Ranch Hand

Joined: Aug 13, 2009
Posts: 50

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

Joined: Aug 16, 2005
Posts: 14273
    
  21

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, ...).


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compiler