Skip to content

Commit 4ba9ecb

Browse files
committed
Fix windows build - add Maven
1 parent 2c4462c commit 4ba9ecb

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

.github/workflows/build-desktop.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,9 @@ jobs:
174174

175175
- name: Create Windows installer
176176
run: |
177-
# Shorten JAVA_HOME to avoid "filename or extension is too long" (CreateProcess env limit)
177+
# Junction for short JAVA_HOME (used only when calling jpackage to avoid CreateProcess path limit)
178178
if (Test-Path C:\j) { cmd /c rmdir C:\j }
179179
cmd /c mklink /J C:\j $env:JAVA_HOME
180-
$env:JAVA_HOME = "C:\j"
181-
$env:PATH = "C:\j\bin;C:\Windows\System32;C:\Windows"
182180
subst X: $env:GITHUB_WORKSPACE
183181
New-Item -ItemType Directory -Force -Path "C:\t" | Out-Null
184182
cd X:\desktop-client
@@ -192,6 +190,9 @@ jobs:
192190
if (Test-Path "src\main\resources\icons\app-icon.ico") {
193191
$ICON_ARG = "--icon src\main\resources\icons\app-icon.ico"
194192
}
193+
# Short PATH only for jpackage to avoid "filename or extension is too long"
194+
$env:JAVA_HOME = "C:\j"
195+
$env:PATH = "C:\j\bin;C:\Windows\System32;C:\Windows"
195196
jpackage --input target `
196197
--name "JSTutor" `
197198
--main-jar $JAR_NAME `

.github/workflows/release-desktop.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,9 @@ jobs:
7676
- name: Build installers and portable app image (Windows)
7777
if: matrix.os == 'windows-latest'
7878
run: |
79-
# Shorten JAVA_HOME to avoid "filename or extension is too long" (CreateProcess env limit)
79+
# Junction for short JAVA_HOME (used only when calling jpackage to avoid CreateProcess path limit)
8080
if (Test-Path C:\j) { cmd /c rmdir C:\j }
8181
cmd /c mklink /J C:\j $env:JAVA_HOME
82-
$env:JAVA_HOME = "C:\j"
83-
$env:PATH = "C:\j\bin;C:\Windows\System32;C:\Windows"
8482
subst X: $env:GITHUB_WORKSPACE
8583
New-Item -ItemType Directory -Force -Path "C:\t" | Out-Null
8684
cd X:\desktop-client
@@ -94,6 +92,9 @@ jobs:
9492
if (Test-Path "src\main\resources\icons\app-icon.ico") {
9593
$ICON_ARG = "--icon src\main\resources\icons\app-icon.ico"
9694
}
95+
# Short PATH only for jpackage to avoid "filename or extension is too long"
96+
$env:JAVA_HOME = "C:\j"
97+
$env:PATH = "C:\j\bin;C:\Windows\System32;C:\Windows"
9798
jpackage --input target `
9899
--name "JSTutor" `
99100
--main-jar $JAR_NAME `

0 commit comments

Comments
 (0)