Skip to main content
IBM 
ShopSupportDownloads
IBM HomeProductsConsultingIndustriesNewsAbout IBM
Java Language EssentialsDownload tutorial zip fileEmail this tutorial to a friend
Main menuSection menuGive feedback on this tutorialPrevious panelNext panel
Exercises
  


1. Testing the Java Environment with SimpleProgram: Help page 3 of 31




  • Task 1

    Copy and paste the code for SimpleProgram from the course notes into a file (or use the SimpleProgram.java file above) in a working directory where you will develop programs for this course.


    For most environments, the source code should be in a file named SimpleProgram.java. Some environments, however, are not source file-oriented (for example, VisualAge for Java), in which case you simply type the code into the appropriate IDE window(s).

  • Task 2

    Compile the Java source file SimpleProgram.java.


    Some Java environments require a CLASSPATH setting. You should set the CLASSPATH environment variable to include the current directory. With the Java Development Kit (JDK) from Sun Microsystems, you can compile SimpleProgram.java easily from the command line:

    
    D:\>javac SimpleProgram.java
    
  • Task 3

    Execute SimpleProgram.


    With the JDK, for example, simply invoke the Java interpreter with SimpleProgram as an argument:

    
    D:\>java SimpleProgram
    


copyright 1996-2000 Magelang Institute dba jGuru


Main menuSection menuGive feedback on this tutorialPrevious panelNext panel
PrivacyLegalContact