Skip to content

aegilops/codeql-java-hello-world

Repository files navigation

Hello, World Java app and basic CodeQL queries

This is a small Java app to demonstrate how to use CodeQL to find program patterns in code.

It prints "Hello, World!" to the console, and "Hello, foo!" if the first command-line argument is "foo".

It has no error handling, so will throw an exception if no command-line arguments are provided.

Prerequisites

  • Java 8 or later
  • CodeQL CLI
  • VSCode
  • GitHub CLI
  • GNU Make (though you can just use the commands in the Makefile, they are not complicated)

Set up the CodeQL CLI and VSCode Starter workspace

You can follow these instructions on how to get set up with CodeQL.

It relies on the GitHub CLI, and VSCode so grab them first if you haven't already.

Build the app

make Main

Run the app

make run

Build the CodeQL database

make clean && make

Run the CodeQL queries

Use the VSCode Starter workspace to load the CodeQL database and run the queries.

License

This is a copyrighted work, and is not released under an open source license.

© Copyright 2024 GitHub, Inc.

About

Hello world Java app and queries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published