Internet Systems Design:
|
Using JavaNote that more detailed instructions are available at: http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html Writing Java Code
How to Download and Install the JDK
How to Compile and Run (Execute) Your Java files
C:\Windows> Change your directory location using DOS command "CD", as shown C:\Windows>cd .. (return) C:>CD j2sdk1.4.0\bin (return) C:\j2sdk1.4.0\bin> Now you can compile your Java code as C:\j2sdk1.4.0\bin>javac JavaFile.java (return) After success of your compiling, your can run your Java Byte code, as C:\j2sdk1.4.0\bin>java JavaFile (return) If you want to compile and run your Java codes in different directory rather than in j2sdk1.4.0\bin directory, you do not need to copy or create your Java code in the bin directory, you can use one of the following methods. Use notepad or another word processing software to open your autoexec.bat file in C drive, and then append the following lines, before you save it. set PATH=c:\j2sdk1.4.0\bin;%PATH%; set CLASSPATH=.;c:\j2sdk1.4.0\lib;%CLASSPATH%; Then, restart your computer. Now you can use javac or java in any directory. Some further and more detailed information is available at http://java.sun.com/docs/books/tutorial/getStarted/cupojava/index.html |
|