Covering the Basics

Covering the Basics

<p> THE BASICS OF PROGRAMMING IN JAVA ON THE CAMPUS</p><p>The 3-step procedure used in java programming:</p><p>Step A: Create a source file and save it. Step B: Compile it (convert into byte code). Step C: Run it (execute it).</p><p>For Solaris operating system on campus (sitting on a windows machine)</p><p> Go to Start, go to All Programs, then go to MOSAIC XP, then go to UNIX connectivity and then click on Exceed Solaris to start the Exceed application.  You will then be prompted for username (id) and password (which is the normal login procedure).After this you will be logged into Solaris system.  Once you are logged into Solaris, the screen which you will get is something similar to this:</p><p> text editor</p><p>You can then follow the steps A, B, C explained below. Step A (creating a source file and saving it)</p><p> Open a text editor to write a java program. You can bring this window up by right clicking the mouse, choosing applications, then choosing text editor. </p><p> The text editor looks something like this:</p><p>Type your program and save it with a .java extension.</p><p>Step B (compiling)</p><p> Bring up a shell (sometimes called terminal) window. You can bring this window up by right clicking the mouse, choosing tools, then choosing terminal. When the window comes up, it should look like this:</p><p> Go to the directory (folder) where you saved your source file and compile the file using javac command. For example the file myprogram.java can be compiled using the command javac myprogram.java</p><p> If your command prompt appears without any error messages, then you have successfully compiled the program. A class file is automatically created by the compiler as a result of compilation operation. The class file has the same name as that of your source file but with a .class extension. For example myprogram.class is formed as a result compilation of your source file myprogram.java </p><p>Step C (Running the program)</p><p> Use the java command to run the program. For example at the command prompt where you compiled your program, type java myprogram (where myprogram is the name of class file which was created in step B)</p><p>For Solaris operating system on campus (sitting on a Solaris machine)</p><p>Follow the steps A, B and C explained above.</p><p>For Submitting the programs for grading use the command as given below cp MyProgram.java /afs/uncc.edu/usr/c/shscott/ITCS1214/section #/userid/</p><p>For Example: If you have to submit Lab1.java and your section number is 091. cp Lab1.java /afs/uncc.edu/usr/c/shscott/ITCS1214/091/l/userid/</p><p>To check if the program has been submitted: cd /afs/uncc.edu/usr/c/shscott/ITCS1214/section #//userid/ and then use ls command to check the contents of the directory.</p><p>For Submitting programs for grading using WINDOWS</p><p>Follow these steps to submit a lab using windows: Copy your java program (source code) to the clipboard Paste the java program into the directory N:\uncc.edu\usr\c\shscott\ITCS1214\section#\userid\</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    4 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us