www.webdeveloper.com
Results 1 to 3 of 3

Thread: won't work

  1. #1
    Join Date
    Sep 2004
    Posts
    7

    Question Resolved

    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");

    }

    }
    ---------------------------------------------------------------------
    Last edited by kid76; 09-13-2004 at 03:08 AM.

  2. #2
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    The script is fine. You must specify the path when compiling the file.
    For example:
    Code:
    javac c:\java\HelloWorld.java
    Regards,
    Andrew Buntine.

  3. #3
    Join Date
    Jan 2003
    Location
    Texas
    Posts
    10,413
    You can also change from the default home directory to your development directory.

    Code:
    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.
    Visit Slightly Remarkable to see my portfolio, resumé, and consulting rates.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles