1 / 8

Program Questions

Program Questions. Try first to have your questions answered by a TA (email or TA office hours). Try the TAs first since this divides the work evenly among TAs and instructors. Downloading. Sun J2SE 1.4.1 Download SDK not JRE Download documentation too (unzip into main JDK directory)

rudolf
Download Presentation

Program Questions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Program Questions • Try first to have your questions answered by a TA (email or TA office hours). • Try the TAs first since this divides the work evenly among TAs and instructors.

  2. Downloading • Sun J2SE 1.4.1 • Download SDK not JRE • Download documentation too (unzip into main JDK directory) • JBuilder 8 Personal • Fill out survey and an email will be sent to you containing a text file; save this file to disk • Documentation not available for version 8

  3. Installation Tips • Accept defaults on JDK installation • Put JDK bin directory (e.g. c:\j2sdk1.4.1_01\bin) in your PATH environment variable • Accept defaults on JBuilder installation • When first starting JBuilder, it will complain about the license being expired. Ignore it. On the registration wizard, click “Have Activation File.” Now point to the email attachment (e.g. reg127.txt) that you saved. • Sample project has a nice “tour” feature.

  4. Submitting Your Programs • Spend the time to create a complete and working zip file! • See program specifications on the web site for exact instructions! • README.DOC • COMPILE.BAT & RUN.BAT • Main class definition in JBuilder • All source and compiled classes in proper directories • And so on… • Check out the example program submittals on the web site!

  5. Common Operations of the JDK • Compile • Go to the directory that contains the .java files and type: javac *.java • Running • Go to the directory that is the root of the package hierarchy and type:java examples.helloworld.HelloWorld • For successful execution of above example, you must be in the directory which hasexamples/helloworld/HelloWorld.class • Notice how the directory structure holding the class file mirrors the package structure.

  6. Packages • Example: • Assume you’ve chosen to put files relating to program1 into c:\program1 • Now you create a text file containing a MyApplet class with a package declaration of appletstuff (i.e. the fully classified classname is appletstuff.MyApplet) • Question 1: Give the full path and filename where this text should be saved • Question 2: Give the full path and filename where the compiled (.class) file should be created (by the compiler)

  7. Packages (continued) • Question 1 Answer: c:\program1\appletstuff\MyApplet.java • Question 2 Answer: c:\program1\appletstuff\MyApplet.class • Typically, source and binary are kept together if working with the JDK. JBuilder separates the two into src and classes directories. • You don’t have to use a package at all! But typically, you do.

  8. Common Operations of JBuilder • New project creation • New application or applet creation • New class creation • Editing (on the fly error detection, code suggestions) • Compiling • Running (defining a main class is important; also runtime configurations) • Make sure you understand the code that JBuilder generates!

More Related