Skip to content

Commit 816a5bf

Browse files
committed
Fixes the loading extensions under Linux
1 parent 5aa1ed5 commit 816a5bf

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/src/main/groovy/org/jd/gui/service/extension/ExtensionService.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ class ExtensionService {
1313
protected ClassLoader extensionClassLoader = initClassLoader()
1414

1515
protected ClassLoader initClassLoader() {
16-
def extDirectory = new File("ext");
16+
def jarUri = ExtensionService.class.protectionDomain.codeSource.location.toURI()
17+
def baseDirectory = new File(jarUri).parent
18+
def extDirectory = new File(baseDirectory, 'ext')
1719

1820
if (extDirectory.exists() && extDirectory.isDirectory()) {
1921
List<URL> urls = []

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ ospackage {
172172
}
173173
from 'LICENSE', 'NOTICE', 'README.md'
174174

175-
postInstall 'cd /opt/'+ project.name+'; ln -s ./jd-gui-'+project.version+'.jar ./jd-gui.jar; xdg-icon-resource install --size 128 --novendor ./jd_icon_128.png jd-gui ; xdg-desktop-menu install ./*.desktop'
176-
preUninstall 'cd /opt/'+ project.name+'; rm -f ./jd-gui.jar; xdg-desktop-menu uninstall ./*.desktop'
175+
postInstall 'cd /opt/'+ project.name+'; ln -s ./jd-gui-'+project.version+'.jar ./jd-gui.jar; xdg-icon-resource install --size 128 --novendor ./jd_icon_128.png jd-gui; xdg-desktop-menu install ./*.desktop'
176+
preUninstall 'cd /opt/'+ project.name+'; rm -f ./jd-gui.jar; rm -fr ./ext; xdg-desktop-menu uninstall ./*.desktop'
177177
}
178178

179179
installOsxDist.dependsOn jar, copyAndReplaceVariablesInInfoPlist

0 commit comments

Comments
 (0)