![]() Learning how to compile directly from within the Windows shell is an essential skill to master. Frequently, a programing IDE adds additional layers of confusion and complexity that complicates debugging and learning. When starting out with Java, many users get confused about compiling the code. I expect you to take some time to understand what's going on.Posted Augby Chris Luongo in Java programming, WindowsĪlthough many people compile Java programs within the IDE, the Windows command line terminal is a powerful compiling option. You may not understand every line of it, but don't just copy and paste. Also, take some time to try to figure out what the code is doing. Then, modify the code to send the email to my address. To test, you may want to send yourself an email first to make sure that your mail is being sent correctly. For lab 1, make sure the output looks correct. Note: If you are using multiple classes in your program you will need to compile all of the files and then run the program by using the classname of the class that contains your main method. Do an "ls" (or "dir" if you are using windows) to verify the class file is there. If the compiler doesn't spit out any errors, it should have generated a ".class" file. Compile by typing javac filename where filename is the name of the file.Setting the path depends on a number of things. If you type "javac" and the command is not recognized, the compiler is not in your path. Make sure that the java compiler is in your PATH.Note: I am assuming that you are not using packages. cd into the directory where your code has been saved.For your first lab you should save the code as "smtpClient.java". If you are writing a class named Test, your file MUST be named Test.java. Important: The name of the file must be the class name with a. Use this as an opportunity to learn more about Java! But, you should be able to understand enough to modify the necessary portions for the assignment. We will talk more about sockets in class. ![]() You may not be able to fully understand all of the code. But, remember that you have a couple of things to modify. For your first lab, copy and paste the code from the tutorial web page. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |