Developing JPO on Windows

Optional: Install a Windows Virtual Machine

If you are mainly on Linux or if you want a clean development machine you can download a temporary Windows 10 virtual machine image from Microsoft here: https://developer.microsoft.com/en-us/windows/downloads/virtual-machines/

Give the VM plenty of Ram and CPU cores.

Set up the Development Environment

Download and install Git from: https://git-scm.com/download

Download and install IntelliJ IDEA Community Edition: https://www.jetbrains.com/idea/download/#section=windows

Download and install OpenJDK 18: http://jdk.java.net/18/ Open the zip and extract the files to c:\Program Files\

Download and install Wix: https://wixtoolset.org/releases/ Wix helps jpackage create a Windows installer file

Get the project into IntelliJ

Start up Intellij IDEA. Leave all the defaults as-is.

You land on a "Welcome to IntelliJ IDEA" screen. Click on "Get from Version Control"

Enter the URL https://github.com/richardeigenmann/JPO.git and click Clone

A red exclamation mark will show up on "Event" because git is not found. Click on "Configure...". In the field "Path to Git executable" type "C:\Program Files\Git\bin\git.exe" You installed it there in the first step above

Now try to do the cloning again.

Confirm "You have checked out and IntelliJ IDEA project file... Open it."

Note that the code was checked out to c:\Users\User\IdeaProjects\JPO if you didn't change anything.

Open Settings and Add SDK for JDK17. File > Project Structure > Project SDK > New > C:\Program Files\jdk-17

The Gradle build system installs itself. Also you want to allow OpenJDK to have access to the Networks

On the right margin you have a tab "Gradle" which gives you access to the tasks"

Pick JPO > Tasks > build > build and it should download dependencies, compile and run the tests.

To run the project go to the Gradle Tasks Window click JPO > build > run.

Create a windows installable package

Updated in 2024 to use jpackage.

Run the Gradle Jpo > Tasks > build > signjar task which will create the build/libs/Jpo-all.jar file

Next run the jpackage command from the command line:

"c:\Program Files (x86)\jdk-21.0.1\bin\jpackage" ^ --type exe ^ --input . ^ --name JPO ^ --description "Java Picture Organizer" ^ --vendor "Richard Eigenmann" ^ --app-version 0.21 ^ --main-jar build/libs/Jpo-all.jar ^ --icon web/favicon.ico ^ --java-options '--enable-preview' ^ --win-shortcut ^ --win-menu ^ --verbose ^ --dest build\executables\


Last update to this page: 3 Mar 2024
Copyright 2003-2024 by Richard Eigenmann, Zürich, Switzerland