WildFly Elytron

Setting up WildFly Elytron on Windows

This page will guide you through the steps needed to setup a development environment for WildFly Elytron on Windows.

Installing Java

  1. First, let’s check if you already have Java installed.

    1. Open Command Prompt and run java --version.

    2. If the output shows a version number, check to make sure it is Java 11 (e.g., "11.0.15.1"). If so, Java 11 is already installed and you can jump to the Installing Maven section. If the output is not Java 11, or if the output is 'java' is not recognized as an internal or external command, operable program or batch file, continue with the following steps.

      1. If you encounter a message such as Java was not found, run without arguments to install from the Microsoft Store, follow these instructions to disable the alias.

    3. Close the Command Prompt.

  2. Go to this page (or use your browser to search for "Download JDK 11") and download the "x64 Installer".

  3. Run the file that you downloaded (installer shown below) and note where it is being installed.

    Screenshot of Windows Oracle JDK installer
    1. Now open Command Prompt and run java --version once again. This time, the output should be something like (the exact version will depend on the version that was installed):

      java version "11.0.15.1" 2022-04-22 LTS
      Java(TM) SE Runtime Environment 18.9 (build 11.0.15.1+2-LTS-10)
      Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.15.1+2-LTS-10, mixed mode)
    2. If you don’t see the output above, that means you’ll need to update your "Path" (optionally, use a temporary configuration):

      1. Search for "Edit the system environment variables" in your Start menu.

      2. Click on "Environment Variables".

      3. Now double click the "Path" entry under "User variables for <Windows username>". Then click "New" and enter the directory from the installer with "\bin" at the end. In this example, we’d need to add C:\Program Files\Java\jdk-11.0.15.1\bin to the "Path".
        Screenshot of the System Properties windows, highlighting the "Environmental Variables…​" button Screenshot of the Environmental Variables window, highlighting the User "Path" variable

      4. Click Ok until all of the windows are closed.

      5. If you now close and re-open the Command Prompt, and run java --version, you should now successfully see the Java 11 version that was installed.

Installing Maven

  1. First, let’s check if you already have Maven installed.

    1. Open Command Prompt, and run mvn -v.

    2. If the output shows a version number, Maven is already installed and you can jump to the Installing Git section. If you get 'mvn' is not recognized as an internal or external command, operable program or batch file, then continue with the following steps.

    3. Close the Command Prompt.

  2. Go to this page and download the latest Binary zip archive (e.g., apache-maven-3.8.6-bin.zip).

  3. Extract the zip and make a note of where it was extracted (e.g., C:\maven-3.8.6).

  4. Add Maven to the "Path" (or use a temporary configuration):

    1. Search for "Edit the system environment variables" in your Start menu.

    2. Click on "Environment Variables".

    3. Now double click the "Path" entry under "User variables for <Windows username>". Then click "New" and enter the directory from the installer with "\bin" at the end. In this example, we’d need to add C:\maven-3.8.6\bin to the "Path".
      Screenshot of the System Properties windows, highlighting the "Environmental Variables…​" button Screenshot of the Environmental Variables window, highlighting the User "Path" variable

    4. Press Ok until all of the windows are closed.

  5. If you now close and re-open the Command Prompt, and run mvn -v, you should now see the Maven version as shown here:

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: C:\apache-maven-3.8.6
Java version: 11.0.15.1, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-11.0.15.1
Default locale: en_CA, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

Installing Git

  1. First, let’s check if you already have Git installed.

    1. Open Command Prompt and run git --version.

    2. If the output shows a version number, Git is already installed and you can jump to the Cloning WildFly Elytron section. If you get 'git' is not recognized as an internal or external command, operable program or batch file, then continue with the following steps.

      1. If you encounter a message such as Git was not found, run without arguments to install from the Microsoft Store, follow these instructions to disable the alias.

    3. You can now close Command Prompt.

  2. Go to this page and download the latest Windows version.

  3. Run the installer and don’t change any of the default options while configuring.

  4. Once the installation is complete, you should be able to open a Command Prompt and once again run git --version. This time, the output will be something like git version 2.37.1.windows.1.

  5. If you already had any IDEs open before, close and reopen them now to load your changes.

Cloning WildFly Elytron

  1. First, configure Git so that it can attribute your commits to you. Run the following commands in the terminal, substituting your own name and email:

    git config --global user.email "<you@example.com>"
    git config --global user.name "<Your Name>"
  2. Next, you’ll need a GitHub account. If you don’t already have one, sign up for one at github.com. Otherwise, make sure you’re logged in.

  3. Fork the WildFly Elytron project into your GitHub account by clicking on the "Fork" button at the top right.

    Screenshot of buttons at top of wildfly-elytron repo, including "Fork" button
  4. Now go to your fork of the repository, the URL will be https://github.com/<USERNAME>/wildfly-elytron. Replace <USERNAME> with your GitHub username.

  5. At this point, you can follow the GitHub guide for adding a new SSH key to your GitHub account to set up an SSH key so you can clone your repository.

  6. At the top right, you will see there is a green "Code" button. Click on that and choose the "SSH" tab. Click on the button next to the url to copy it.

    Screenshot of options under "Code" button, under HTTPS tab. Default URL is https://github.com/<USERNAME>/wildfly-elytron.git
  7. Open your terminal and navigate to the directory where you want to clone this project. Then enter git clone [URL] and replace [URL] with the URL you copied in step 6. Now you should see a directory called wildfly-elytron that contains the code for the WildFly Elytron project.

  8. Next, add a remote reference to upstream, for pulling future updates from the source repository. Execute the following command in the terminal:

    cd wildfly-elytron
    git remote add upstream https://github.com/wildfly-security/wildfly-elytron.git

Building WildFly Elytron

  1. Open a Command Prompt.

  2. Navigate to the wildfly-elytron project directory and run mvn clean install. This will build the project.

  3. Check out the Getting Started for Developers guide to learn more about the WildFly Elytron project and how to run tests.

Restoring Configuration

If you need to restore your original system configuration at some point, you can follow the steps here.