CPSC 327 Data Structures and Algorithms Spring 2024

CPSC 327 Software Setup

Several assignments will involve programming in Java. The tools that you need (Java 17, JavaFX 17.0.10, Eclipse 2022-06) are available on the lab computers in Rosenberg 009 (reboot them to Linux) and Lansing 310, or you can install them on your own computer.

If you want to set up your own computer for programming in this course, you will need several things:

You can download Eclipse 2022-06 here - select the "Eclipse IDE for Java Developers" version (not the "Installer") partway down the page and choose the appropriate version for your computer (Mac, Windows, or Linux; choose the x86_64 version unless you have a newer M1 Apple device). While it is recommended that you use this version of Eclipse, things will likely still work fine with a slightly older or newer version.

Eclipse 2022-06 includes Java 17, so you no longer need to download that separately.

You can download JavaFX from https://gluonhq.com/products/javafx/. In the "Downloads" section (scroll down), choose the right JavaFX version (17.0.10), operating system, and type (SDK) from the dropdown menus to narrow the list of download links. You'll also need to choose the right system architecture - most likely x64 unless you have a newer M1 Apple device (aarch64). Unpack the compressed archive file you downloaded (see below).

To unpack the JavaFX (and possibly Eclipse) archives downloaded, double-clicking on the file should either extract the contents or start a program that will let you extract the contents. The extracted files can go anywhere, but make a note of where they end up.

You will also need a way to transfer files between your computer and the department filesystem. Using a file transfer program is more convenient than emailing files to yourself, and doesn't require you to remember to transfer the files before leaving the lab. See the SSH, SFTP, SCP section of Using Linux at HWS for information about commandline options (scp, sftp) which may already be available on your computer. If you prefer a GUI tool and don't already have one, FileZilla is free and runs on all platforms. (You only need to download the client, not the server.) Be sure to check out the documentation (especially the usage instructions). Use math.hws.edu for the host and port 22 when establishing a connection.

Next, configure Eclipse to use the JavaFX libraries and to set certain formatting and coding conventions:

Note that Eclipse projects store some environment-specific configuration information and Eclipse does some management of the workspace directory on its own, so if you are working on both the CS computers and your own, your best bet for transferring projects is to copy the project folder somewhere other than into your workspace, create a new project within Eclipse on the current computer (if you don't already have one for the program you are working on), and then import the source files from the copied folder to the new project via Eclipse. It's a bit awkward but it gets the job done.

Finally, test your JavaFX setup:

If there are compiler errors after you import the file or runtime errors when you try to run the program, there is something wrong with your JavaFX setup. Double-check the last two steps in the Eclipse setup section above (the two that have to do with JavaFX) and if there are still errors, ask for assistance. If everything is well, running the program should pop up a window with several buttons that you can click.

Stop by office hours if you need help with any aspect of getting your computer set up or sorting out the workflow of how you'd actually use all these pieces once they are installed and configured. (Bring your laptop.)