Today is July 10, 2009. A290/A590 Java/J2EE starts. This coincides with the second part of A202/A598. The lectures are daily (MTWRF) in LH115 between 3:30-4:45pm. The labs are TWR 5:30-7:15pm in LH115. Labs are mandatory for A202/A598, recommended for A290/A590. My name is Adrian German (dgerman@indiana.edu) LH201D 5-7860. Office hours are updated daily at: http://silo.cs.indiana.edu:44063/cgi-bin/sum2009a202/schedule http://www.cs.indiana.edu/classes/a202 is our website. Questions for today send by e-mail to dgerman@indiana.edu 1. Name, major, username, reasons for taking the class 2. Expectations, fears and concerns 3. What would you want to be able to do at the end of this class to feel accomplished. 4. Any other questions, comments, complaints, thoughts. We have 13 days and 5-10 assignments to learn Java. Most of you should have learned a programming language before. For example: Python. My goal for you as far as this class is concerned: a) be able to program solutions to wide range of problems in Java b) be able to learn other programming languages on your own later So let's start learning Java. Dan says that we might need: -- program editor to write programs (IDLE, emacs, pico, notepad) -- save programs as whatever.py, One.java -- compiler Leo says a compiler checks your syntax and runs your program. examples: F5 in IDLE, on silo #!/usr/bin/python and chmod 700 followed by ./one The process is compilation followed by execution. In Java the compiler is available from the command line: javac Once a program (One.java) is compiled you need to run java on it. The command java is referring to the interpreter, that executes the compiled code. On a PC you need to open a command prompt window first. Navigate to the folder where your program is. Then issue javac One.java and tell me what you see. To install Java you need to follow these steps: http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html http://java.sun.com/javase/6/webnotes/install/index.html Step 4 (update the PATH variable) is the most important one. C:> "\Program Files\Java\jdk1.6.0_\bin\javac" MyClass.java In LH115 this is: "\Program Files\Java\jdk1.6.0_07\bin\javac" One.java Now compilation happens and if there are errors they are reported. If no errors a .class file (or more) will be created. In our file (One.java) we have a class (One) so we get One.class with javac. But in general this has a few more cases we could discuss. So just for now we get One.class and we need to run it. The interpreter is named java and it will run/execute this .class file. The command, as you may have guessed, is: "\Program Files\Java\jdk1.6.0_07\bin\java" One So you need the full path and you should not type the .class extension. Let me know if you have trouble installing it at home. In class we will use: a) DrJava b) BlueJ c) javac/java on silo d) javac/java on the desktop On silo towards the end we install Tomcat and develop servlets and JSPs (with access to MySQL). Nathan asked if we can choose what we work in and stay with it. Dean asked about Eclipse and JBuilder. We had trouble setting the PATH so we might use DrJava on Monday. Or we might use silo. Or we might clarify the PATH issue (I had to set it as admin to work). There are no exams, just assignments, to be decided based on guidelines from the instructor. If you have a big project in mind you need to split it in five milestones and turn those in. the code we developed today: class One { public static void main(String[] args) { System.out.println("Howdy."); } } chat system Sample textbook: http://www.libraries.iub.edu/scripts/countResources.php?resourceId=59555 (use your IUB network ID to get in then search for Java) Ivor Horton's Beginning Java 2, JDK 5 Edition by Ivor Horton Wrox Press (c) 2005 (1512 pages) Citation ISBN:9780764568749 Use this easy-to-use guide to learn how to start programming in Java, covering everything from putting together statements and performing calculations to applying the capabilities provided by the Java class libraries, and much more. The book below is way too advanced for this class but a good source (follow-up guide) for after the class is over: http://www.amazon.com/Design-Patterns-Java-e-ebook/dp/B001PBSDKW/ref=sr_1_2?ie=UTF8&s=books&qid=1247260174&sr=8-2