Skip to content

Instructions to run in VSCode

Bogdan Dit edited this page Oct 25, 2022 · 3 revisions

Install Extensions for VSCode

Install the following VSCode extensions:

  • Extension Pack for Java, which will automatically install for you the following extensions:
    • Language Support for Java™ by Red Hat
    • Debugger for Java
    • Test Runner for Java
    • Maven for Java
    • Project Manager for Java
    • Visual Studio IntelliCode
  • [Optional]: Gradle for Java
    • this extension will allow you to issue gradle commands using a GUI, instead of issuing them from the command line

VSCode: Install 'Extension Pack for Java'

Your VSCode should have at least the following Java-related extensions installed:

VSCode: Installed 'Extension Pack for Java'


Run applications

To run the main method from GeneBankCreateBTree.java follow the steps in the gif below: VSCode: Run GeneBankCreateBTree

VSCode: Run GeneBankCreateBTree Annotated

Similarly, you can run the main methods in:

  • GeneBankSearchBTree.java and
  • GeneBankSearchDatabase.java

Run jUnit tests

There are multiple ways to run jUnit tests, as shown in the gifs below:

From the Testing view:

VSCode: Run jUnit Tests from Testing View

From the Explorer -> Java Projects view:

VSCode: Run jUnit Test from Explorer View

It is expected that some tests will fail, since the functionality they test is not yet implemented. VSCode: Run jUnit Tests (It is expected that some tests will fail)


Avoid committing changes to Eclipse configuration files

The following configuration files were originally created to ensure that a student is able to successfully open this project in Eclipse:

  • .classpath
  • .project
  • .settings/org.eclipse.buildship.core.prefs

However, VSCode makes changes to these files. Avoid committing and pushing these changes to your repository, otherwise your team members may have issues running the project after pulling these files on their machines.

VSCode: Do Not Commit Configuration Files

Can we delete the Eclipse configuration files if none of us are using Eclipse?

Yes. If nobody in your team is using Eclipse, then feel free to:

  • completely delete these configuration files
  • add these files to .gitignore (so they will not be tracked in the future), as shown in the image below
  • commit the deleted files and the changes to .gitignore, and
  • push the commit to your repository

As a side note, IntelliJ IDEA does not require these Eclipse files, so these are safe to delete. VSCode: Ignore Eclipse Configuration Files