Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes running java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "running java" Watch "running java" New topic
Author

running java

keith wheeldon
Greenhorn

Joined: Jun 26, 2004
Posts: 2
ive justpicked up a java 2 beginners guide to start learning java.i copied this simple program in word pad:class example{public static void main(string args[]){
system.out.println("java drives the web");}}
and it says that the java sdk 1.4 version that i down loaded runs in command prompt and that i should compile like this:c:\>javac example.java
but when i press enter i get javac is not a recognisable command.please help as i havent a clue what im doing and i feel i might be going in over my head but im determined to learn java
Darin Niard
Ranch Hand

Joined: Jun 08, 2004
Posts: 118
You need to put the directory where javac lies in your PATH environment variable.
[ June 26, 2004: Message edited by: Darin Niard ]
Ben Buchli
Ranch Hand

Joined: Mar 26, 2004
Posts: 83
Hey Keith,
I'm not sure about this, but word pad might add formatting characters (which the compiler cant read), so you may want to try a different word editor such as notepad. Or you can download an IDE such as eclipse and use that.
hope that helps.

Ben
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
Welcome to JavaRanch, keith!

You'll likely want to follow the instructions specific to your operating system, as described in the "Your First Cup of Java" lesson of Sun's Java Tutorial.

If you can't get things working, just ask for more help. Folks around here will be glad to help.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: running java
 
Similar Threads
Emma Coverage report Error
Timer wrong constructor?
java.lang.AssertionError: {unused}. Exception using ant 1.6.5 and JDK1.5.0_10
package?
Trying to install Java JDK... Not sure which variables to change