From 6661c73bbbca85fb3a8a7979f279dec843ff1945 Mon Sep 17 00:00:00 2001 From: tjens23 Date: Thu, 25 Dec 2025 19:07:39 +0100 Subject: [PATCH 1/2] Shell.nix for nixos --- shell.nix | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..15dca0a2a --- /dev/null +++ b/shell.nix @@ -0,0 +1,46 @@ +{ pkgs ? import {} }: + +pkgs.mkShell { + name = "jhotdraw-dev"; + + buildInputs = with pkgs; [ + # Java Development Kit (JDK 21 with full GUI support) + jdk21 + + # Build tool + maven + + # GUI/X11 dependencies for Swing applications + xorg.libX11 + xorg.libXext + xorg.libXrender + xorg.libXtst + xorg.libXi + fontconfig + freetype + + # Optional: useful dev tools + git + ]; + + # Set JAVA_HOME + JAVA_HOME = "${pkgs.jdk21}"; + + # Ensure AWT/Swing can find the display + shellHook = '' + export _JAVA_AWT_WM_NONREPARENTING=1 + + echo "==========================================" + echo "JHotDraw Development Environment" + echo "==========================================" + echo "Java: $(java -version 2>&1 | head -1)" + echo "Maven: $(mvn -version 2>&1 | head -1)" + echo "" + echo "Commands:" + echo " mvn clean compile - Build the project" + echo " mvn test - Run tests" + echo " mvn exec:java -pl jhotdraw-samples/jhotdraw-samples-misc" + echo " - Run SVG sample app" + echo "==========================================" + ''; +} From 5aef360b59606c84d12f58917dda9da4ffc53cc3 Mon Sep 17 00:00:00 2001 From: tjens23 Date: Thu, 25 Dec 2025 19:13:37 +0100 Subject: [PATCH 2/2] shell --- shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 15dca0a2a..6fd5189dd 100644 --- a/shell.nix +++ b/shell.nix @@ -39,7 +39,7 @@ pkgs.mkShell { echo "Commands:" echo " mvn clean compile - Build the project" echo " mvn test - Run tests" - echo " mvn exec:java -pl jhotdraw-samples/jhotdraw-samples-misc" + echo " mvn exec:java "-Dexec.mainClass=org.jhotdraw.samples.svg.Main" jhotdraw-samples/jhotdraw-samples-misc" echo " - Run SVG sample app" echo "==========================================" '';