Putting your Java labs on Eclipse

To put your java labs from Eclipse to a web server you will need to provide an html page that will open the applet. Here is an example from your lesson 5 code for Duke.
  1. First take your .java file and put a copy on the Unix machine. I suggest you either make a new file on the Unix machine and cut and paste the file content OR move/drag a copy over from your Eclipse workspace folder. If you do just drag to move from Eclipse do it from your worskpace folder rather than trying to drag it from directly inside Eclipse since the eclipse version might have extra stuff in it.

    For this example I needed to copy the images folder as well.

  2. Next compile the code on the unix machine using:
    javac Duke.java

    This will result in a Duke.class file

  3. Hopefully there are no compilation errors. Compilation errors will show on the console of the machine that you tried to compiled it on.
    Runtime errors for Applets will show on the Java Console (in FireFox under Tools - maybe IE will open the icon in the toolbar) (for Macs)

  4. We will need an html page for the browser. Here is one that will pick our Duke class
    Mac folks - if you are having problems with the supplied Mac editor on your local machine, you can use Eclipse as your text editor.

    Go to its location on a browser as here

    Repeat

    1. Move ClassName.java to Unix machine
    2. Compile there: javac ClassName.java ... this creates a ClassName.class file
    3. Make a .html file with an applet tag pointing to the .class and provide it in the same folder as the .class