We will assume that you have already taken the steps needed to allow yourself to write Java code in VS Code. See Task 5 of Lab 0 for more details.
If you haven’t already done so, you should create a
subfolder called ps3
within your cs460
folder, and put all of the files for this assignment in that folder.
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 ps3
folder so that you can easily find and open it
from within VS Code.
If you have trouble with any of these steps, please come to office hours or post a question on Piazza.
Launch VS Code on your laptop.
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 October 21, 2024.