Compiling and Running a Java Program Using JBuilder

  1. Launch JBuilder and select File -> New Project.
  2. Name the project (for example, lab1) and specify the directory where you would like to save the project.
  3. You can leave everything else as the default value, so select Finish.
  4. Select File -> New File.
  5. Important: The "Name" of the file must be the class name with a .java extension. If you are writing a class named Test, your file MUST be named For your first lab you should create a new file named "smtpClient". If you leave the type as "java", it will automatically add the ".java" extension to the file.
  6. Write the code. For your first lab, copy and paste the code from the tutorial web page. But, remember that you have a couple of things to modify. You may not be able to fully understand all of the code. We will talk more about sockets in class. But, you should be able to understand enough to modify the necessary portions for the assignment. Use this as an opportunity to learn more about Java!
  7. Compile by selecting Project -> Rebuild Project "X" (where X is the name of your project). Note: The tutorial code may give you deprecation warnings. Don't worry about that for now.
  8. Run by selecting Run ->Run "X" using defaults (where X is the name of your java file).
  9. You should see the output at the bottom of the screen. For lab 1, make sure the output looks correct. To test, you may want to send yourself an email first to make sure that your mail is being sent correctly. Then, modify the code to send the email to my address. Also, take some time to try to figure out what the code is doing. You may not understand every line of it, but don't just copy and paste. I expect you to take some time to understand what's going on.

Sami Rollins