90 likes | 276 Views
Tutorial 1 Introduction to Java Programming. Bo Chen Department of Computer Science. Login your computer. Using your NJIT UCID to login your computer Note:
E N D
Tutorial 1Introduction to Java Programming Bo Chen Department of Computer Science
Login your computer • Using your NJIT UCID to login your computer Note: UCID is very important during your college life, don’t forget it or disclose it to somebody else. If you don’t know your UCID, refer to Computing Helpdesk 973-596-2900 or http://ist.njit.edu/support/helpdesk.php
Set up java development environment Note: java development environment should have been set up in lab computers, there is no need for you to install it in lab computer again. You can install it to your laptop. • Download jdk1.6 from sun website Note:You can download it from njit software, but that version is too old. http://java.sun.com/javase/downloads/index.jsp Choose Java SE Development Kit Note: jre1.6 is included in jdk1.6
Set up java development environment • Install it by simply clicking note: I would not show this, since it would require a lot of time • Configure the running environment for jdk settings->control panel->system->advanced ->environment variables->system variables Add a new system variable JAVA_HOME with value C:\Program Files\java\jdk1.6.0_16
Set up java development environment Add to the existed system variable Path ;%JAVA_HOME%\bin Add a new system variable CLASSPATH with value .;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar Note: do not miss even one character above or you will go mad. Default path for java is C:\Program Files\java\. After jdk is installed, check whether java is in this path or not
Build your first java program • Open notepad • Write your first hello world! Program • class helloworld • { • public static void main(String args[]) • { • System.out.println("Hello, World!"); • } • }
Build your first java program • Save your file as helloworld.java Note: the default file type for notepad is .txt Q: do you know how to save the file as .java? • compile your first java program change the command line to the path that you save your java file. Change between different disks d: Change between different fold cd ** compile jave program javac helloworld.java
Build your first java program • run your first java program java helloworld When your see the command line shows Hello, World! Congratulate! You have finished your first java program
Do assignment1 and Ask questions • I would be grad to help • Lab tutorial and assignment could be download in http://web.njit.edu/~bc47/courses/cs113a.htm Note: Keep in mind that it is your responsibility to check the update of this webpage. It is the only official webpage for cs113A(NJIT 2009 fall)