Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help me compile simple program
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
richcash




PostPosted: Tue Sep 05, 2006 3:37 pm   Post subject: Help me compile simple program

Well, I installed JDK 5.0 on my computer (and it took up a lot of space!) and then tried to test it out by writing this code :
code:
/**
 * The HelloWorldApp class implements an application that
 * simply prints "Hello World!" to standard output.
 */
class HelloWorldApp {
    public static void main(String[] args) {
        System.out.println("Hello World!"); // Display the string.
    }
}

code from official java tutorials website
Then I went to command and was in the appropriate directory (because I saw the .txt file that I saved this code in) and I typed in javac filename.txt. It didn't recognize it and said javac was neither an internal or external command, etc.
My teacher said I have to download the JAR and the Application at drjava.org website, but can someone tell me if that's the problem and if I really need those before I go and download even more!
Sponsor
Sponsor
Sponsor
sponsor
richcash




PostPosted: Tue Sep 05, 2006 4:29 pm   Post subject: (No subject)

No edit or delete button! Sorry for the double post
I made a typo, just in case you get confused. I obviously type in javac filename.java (instead of .txt like I typed above) and it didn't recognize javac as a command as I said above.
Andy




PostPosted: Tue Sep 05, 2006 5:20 pm   Post subject: (No subject)

you need to setup your environment variables
richcash




PostPosted: Tue Sep 05, 2006 7:32 pm   Post subject: (No subject)

Thanks Andy, it works now, that was exactly the problem (I didn't read that page the first time I saw it!).
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: