Hi There!

I'm Dan Schlegel, an Associate Professor in the Computer Science Department at SUNY Oswego

Development Environment Configuration on Windows 10

The following instructions will explain how to set up the suggested build environment on Windows. You will install the Windows Subsystem for Linux with Ubuntu, and VcXsrv to use graphical Linux applications. You will also install the Emacs text editor. For development, you’ll install Java 8, the Gradle build tool, and Error Prone, a tool for identifying possible issues with your code.

  1. Install VcXsrv, an application which will allow you to use graphical Linux applications on Windows.
  2. Install Windows Subsystem for Linix (I’ll assume you installed Ubuntu)
  3. Start your Ubuntu installation and configure your environment by running the below commands (note lines beginning with # are comments):
SDKMAN will ask you to run a command when it finishes installing. Do it.
Back in Windows, start VcXsrv from the start menu. Then, run emacs by typing the following into your Ubuntu terminal:
Press the Ctrl and x key, followed by Ctrl and f key. This is usually annotated as:
The result of this is to tell emacs you would like to open a file. At the bottom of the window (in the minibuffer) it will say “Find file: ~/”. At this prompt type:
and press enter. What will load will likely be a blank file, but it may contain some text. Add the following to the top of the file:
This adds a repository to the package manager in emacs.

Save the file by hitting C-x, C-s. Then, exit emacs (C-x, C-c) and restart it.

Once emacs restarts, type:

The M-x means “Meta and the x key” where the meta key is usually the Alt key on most keyboards.

A list of packages will be displayed. Scroll down to JDEE and click on it. Choose to install it.

Your build environment is now configured! Let’s test it.

Create a new folder called csc241 in your home directory, and inside that a new folder called testproject. Then navigate into testproject.

In emacs, open the (new) file ~/csc241/testproject/build.gradle

This file will contain the configuration for the project.

In your build.gradle, add the following:

This tells Gradle to use Java to build this project, and to use the Error Prone plugin. Save the file.

Gradle expects to find your source code under src/main/java, so make those directories in the terminal. Then, open the file ~/csc241/testproject/src/main/java/Main.java in emacs.

Create a “hello world” style program in that file and save it.

Back at your terminal, type

Gradle will then build your project. (Note you can see the other things you can ask Gradle to do by running gradle tasks.)

Now, assuming you had no errors you need to fix, change into the ~/csc241/testproject/build/classes/java/main directory and run

Your program should run.