In the work on Part II and on later problem sets, you will need to use a Java IDE.
Our recommended IDE is VS Code, and the steps needed to obtain and install it depend on the operating system that you’re using. Select the appropriate link below:
You should begin by downloading the following zip file:
dbms.zip
Unzip/extract the contents of the file.
Depending on your system, after extracting the contents you will either have:
a folder named dbms
that contains all of the Java files that
you need for this assignment
an outer folder called dbms
that contains an inner folder named
dbms
that contains all of the Java files that you need for this
assignment.
Take the dbms
folder that actually contains the Java files and drag
it into your ps2
folder so that you can easily find and open it
from within VS Code.
Launch VS Code on your laptop:
On Windows, use the Windows button in the Taskbar to search for and run Visual Studio Code.
On macOS, use the Spotlight tool to search for and and run Visual Studio Code.
In VS Code, select the File->Open Folder or File->Open menu
option, and use the resulting dialog box to find and open the
dbms
folder that you created above – the one that contains the
Java files. (Note: You must open the folder; it is not
sufficient to simply open one of the Java files in the folder.)
The name of the folder should appear in the Explorer pane on the left-hand side of the VS Code window, along with a list of all of its contents.
Use the Terminal->New Terminal menu option to open a Terminal window, which should be displayed in the lower half of the VS Code window.
Note: If you select one of the Java files in the Explorer pane, the Problems section in the Terminal window will display a large number of warnings. This is to be expected, and you can safely ignore them.
Compiling the code
Make sure that you are in the Terminal section of the Terminal
window. Then enter the following command from the Terminal command
line to compile the code:
javac -cp 'lib/*' -d classes *.java
You will see the following expected warning messages:
Note: Parser.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.
You can safely ignore them.
Running the program
You should not use any of the usual approaches to running a
Java program in VS Code. Instead, you should enter the appropriate
command from the Terminal command line:
on Windows:
java -cp 'lib/*;classes' DBMS
on macOS or Linux:
java -cp 'lib/*:classes' DBMS
Note: The two commands are almost identical, but in the Windows
version there is a semi-colon (;
) before the word classes
, whereas
the macOS/Linux version uses a colon (:
).
After entering the appropriate command, you should see the following:
Enter command (q to quit):
For now, you should simply enter q
to quit the program.
Last updated on September 10, 2024.