Click to See Complete Forum and Search --> : won't work


kid76
09-13-2004, 01:35 AM
For sum reason when i try to run this java app
it doesn't work
i go to dos and type in --javac HelloWorld.java-- and
it says no such file exist on disc or whatever
i saved it as that exactly i don't understand y it won't work
-----------------------------------------------------------------

public class HelloWorld {

public static void main (String [] args) {

System.out.println("Hello World");

}

}
---------------------------------------------------------------------:confused: :confused: :confused: :confused: :confused:

buntine
09-13-2004, 03:15 AM
The script is fine. You must specify the path when compiling the file.
For example:

javac c:\java\HelloWorld.java

Regards,
Andrew Buntine.

Jona
09-14-2004, 08:28 AM
You can also change from the default home directory to your development directory.


cd c:\java\development\
javac HelloWorld.java
java HelloWorld


So long as "javac" and "java" are both in your environmental variables, and C:\java\development\ is the location of your .java (and compiled class) file. That may make it easier for you so you don't have to type out the path each time, though I'd suggest looking into getting an IDE. Working in DOS/Notepad works, and that's about it. :p