Compiling and Running Java from WinSCP

Download the latest stable release (do not download a beta) from this link: WinSCP

Install and run. Click the New button to connect to a remote server.

Fill in the information to connect to ocelot.

  1. Host Name: ocelot.aul.fiu.edu
  2. Port: 22
  3. User Name: your Panther mail user ID
  4. Password: it will start as first initial followed by pid followed by last initial (fpidl)
  5. Protocol: SFTP (allow SCP fallback)

Click the Login button to connect.

Once you are connected, you will see two file lists: the one on the left contains the files for the local machine; the one on the right contains the files for the remote machine.

At the bottom of the screen are links that perform common operations. The links include the function keys that do the same task.

  1. F2 Rename
  2. F4 Edit
  3. F5 Copy
  4. F6 Move
  5. F7 Create Directory
  6. F8 Delete
  7. F9 Properties
  8. F10 Quit

Click in the right hand pane and press the F7 key to create a directory named cop2250.

Double-click the new directory to see that it is empty.

Right-click in the right hand pane and select New -> File. Give it the name FirstProgram.java and click OK. Enter the following code into the editor that opens.

public class FirstProgram {
  
  public static void main( String args[] ) {

    System.out.println( "Hello Java" );

  } 

}

Save the file (Ctrl-S).

Select the menu options Commands -> Open Terminal (Ctrl-T)

Compile the file with the command: javac FirstProgram.java

If there are errors, then close the terminal and return to the editor. Fix the errors and compile the file again. Continue until you have no errors.

When there are no errors, you will see that the FirstProgram.class file has been created.

Once there are no errors, run the class with the java command: java FirstProgram

Notice that you compile a file (javac FirstProgram.java), but you run a class (java FirstProgram).