I recommend that you use the environment described below. (This is not because it is necessarily the best environment but because it is fairly easy to install on all platforms, it is easy to use, provides all of the capabilities you will need, and does not provide too many capabilities.) In fact, I will assume that you are doing so and will be unable to provide assistance if you are not. However, the choice is up to you.
My Documents
, you should avoid doing so when you can.
That said, some of the software you install may want to use names that include spaces and, unless you're confident, you should not change the defaults.
Java SE Development Kit v14
(You may use the OpenJDK if you prefer, which can be downloaded from
jdk.java.net/14
, but the Oracle version is easier for
most people to install. Make sure you download the version for
your operating system.)
jGRASP v2.x
(There is a version that is "bundled with the OpenJDK",
however, if you install that version it will be more difficult for
you to use Java from the command shell. So, I recommend the version that
"requires Java". Make sure you download the version for
your operating system.)
Checkstyle v8.35
(This is just a single file with an extension
of .jar
. Because of its extension, in most browsers
you can download it by clicking on the link. However, in some
browsers you may need to right-click or control-click on the
link.)
CS149 Style Checks
(This is just a single file with an extension of .xml
.
Because of its extension, to download it in most browsers you need to
right-click/control-click on the
link and select Save.)
Note that if you have not written programs in Java before then you probably do not have the JDK installed. You might think you do because you have the Java Runtime Environment (JRE) installed, but the two are not the same. The JRE only allows you to run programs written in Java, it does not allow you to write them.
While you may use any file comparison utility you, you should be careful when choosing one. The lab computers use Meld so, if you are running Linux and want to be consistent, you should install it. Otherwise, you should probably install kdiff3 (which is available for all major platforms).
javac
executable. To see if this is the case, open a
terminal window (a.k.a., command shell window) and type
javac -version
and hit return. If everything
is setup properly, you will get a message like javac 1.14.xxx
.
If not, you will need to add the directory/folder that contains the
javac
executable to the search path (which is different from
the class path that Java itself uses, so don't be confused).
The process for doing so is described on the
Java download site (and elsewhere on the WWW).
/** * Test the installation of the CS149 development environment. * * @author Prof. David Bernstein, James Madison University * @version 1.0 */ public class InstallationTest { /** * The entry point of the program. * * @param args The command line arguments */ public static void main(String[] args) { System.out.println("Java is installed correctly."); } }into the editing window.
InstallationTest.java
,
and click on Save.Java is installed correctly.
in the Run I/O window.
Starting audit...
[ERROR] InstallationTest.java:14: 'method def modifier' has incorrect indentation level 4, expected level should be 3. [Indentation]
[ERROR] InstallationTest.java:15: 'method def' child has incorrect indentation level 8, expected level should be 6. [Indentation]
[ERROR] InstallationTest.java:16: 'method def rcurly' has incorrect indentation level 4, expected level should be 3. [Indentation]
Audit done.
InstallationTest.java
.
If you don't know how to do this, search the WWW for
the "cd command" in your operating system.javac InstallationTest.java
.
java InstallationTest
.
Java is installed correctly.
If, at any time, you get a message like "unrecognized" or "not a command", you need to configure the terminal window (a.k.a., command shell) as discussed above.
Copyright 2020