1.0 Updates:
- none
Command line compile of Java programs.
Unless otherwise noted, Java submissions must compile at the
command line, or they will receive only minimal credit as non-running
programs. We will not repair your java code to fix compile issues.
We will not grade any assignments that have package statements in
your source code. If you use an IDE you will likely have to remove these manually. See below.
You are free to develop using any Java IDE you prefer, such as, e.g.,
IntelliJ, Eclipse or VSCode. However, once you are finished with development you must
do the following to receive credit for your work:
- Place all your Java code in a single file, with the correct name. For
example, JokeServer.java . (You can do this from the start of
development to avoid problems later.)
- Remove ALL package statements from your code. (You can do this right
from the start of development which can avoid problems later, and you should strongly consider doing so for these
assignments.)
- Copy your single java source code file into a new, clean, otherwise
empty directory.
- IN THAT DIRECTORY CONTAINING ONLY THE ONE JAVA FILE, execute the following
commands:
- MyDir> java -version
- MyDir> javac *.java
- MyDir> javac *.java
- The first command allows you to verify that you are using the
correct version of java for this course.
- The second command will compile your .java file [Note: you can replace
the "*.java" with the name of your file, e.g., "JokeServer.java"]
- The third command will compile your java file again, picking up any
references to classes missing the first time. If you have no compile
errors after the second step, you can skip this third step.
If you don't get a clean, successful compile, then you must repair your code
until you do get a clean compile.
The compile step is likely to generate many .class files in your new
directory. This is normal and expected.
Note: To test your compile a second, or third time, etc., you must first remove all .class
files from the directory to make it "clean" again.
Once you have an absolutely clean compile, you should run the various
programs in your assignment project from the command line with each
process in a different directory, created exactly the same way. For example:
- MyDir java JokeServer
- MyDir java Jokeclient [in a separate command window /
process / virtual machine]
- MyDir java JokeclientAdmin [in a separate command window
/ virtual machine]
In many cases, to activate the required plagiarism checker, when you are
completely done with development, you must copy your unmodified .java file to a file
with the same name and the extension .java.txt . For example you would copy
JokeServer.java to JokeServer.java.txt . Then, you would submit
the JokeServer.java.txt file (only) to D2L for grading, before the deadline.