Skip to content

Commit

Permalink
feat: replace jre with jdk
Browse files Browse the repository at this point in the history
  • Loading branch information
notmeta committed Nov 13, 2024
1 parent 856e8b5 commit 82fc66d
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 68 deletions.
4 changes: 2 additions & 2 deletions installer/innosetup/rsprox.iss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Source: "..\build\win-x64\RSProx.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\build\win-x64\rsprox-launcher.jar"; DestDir: "{app}"
Source: "..\build\win-x64\launcher_amd64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\build\win-x64\config.json"; DestDir: "{app}"
Source: "..\build\win-x64\jre\*"; DestDir: "{app}\jre"; Flags: recursesubdirs
Source: "..\build\win-x64\jdk\*"; DestDir: "{app}\jdk"; Flags: recursesubdirs

[Icons]
; start menu
Expand All @@ -44,7 +44,7 @@ Filename: "{app}\RSProx.exe"; Description: "&Open RSProx"; Flags: postinstall sk

[InstallDelete]
; Delete the old jvm so it doesn't try to load old stuff with the new vm and crash
Type: filesandordirs; Name: "{app}\jre"
Type: filesandordirs; Name: "{app}\jdk"
; previous shortcut
Type: files; Name: "{userprograms}\RSProx.lnk"

Expand Down
4 changes: 2 additions & 2 deletions installer/innosetup/rsprox32.iss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Source: "..\build\win-x86\RSProx.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\build\win-x86\rsprox-launcher.jar"; DestDir: "{app}"
Source: "..\build\win-x86\launcher_x86.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\build\win-x86\config.json"; DestDir: "{app}"
Source: "..\build\win-x86\jre\*"; DestDir: "{app}\jre"; Flags: recursesubdirs
Source: "..\build\win-x86\jdk\*"; DestDir: "{app}\jdk"; Flags: recursesubdirs

[Icons]
; start menu
Expand All @@ -44,7 +44,7 @@ Filename: "{app}\RSProx.exe"; Description: "&Open RSProx"; Flags: postinstall sk

[InstallDelete]
; Delete the old jvm so it doesn't try to load old stuff with the new vm and crash
Type: filesandordirs; Name: "{app}\jre"
Type: filesandordirs; Name: "{app}\jdk"
; previous shortcut
Type: files; Name: "{userprograms}\RSProx.lnk"

Expand Down
4 changes: 2 additions & 2 deletions installer/innosetup/rsproxaarch64.iss
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Source: "..\build\win-aarch64\RSProx.exe"; DestDir: "{app}"; Flags: ignoreversio
Source: "..\build\win-aarch64\rsprox-launcher.jar"; DestDir: "{app}"
Source: "..\build\win-aarch64\launcher_aarch64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\build\win-aarch64\config.json"; DestDir: "{app}"
Source: "..\build\win-aarch64\jre\*"; DestDir: "{app}\jre"; Flags: recursesubdirs
Source: "..\build\win-aarch64\jdk\*"; DestDir: "{app}\jdk"; Flags: recursesubdirs

[Icons]
; start menu
Expand All @@ -44,7 +44,7 @@ Filename: "{app}\RSProx.exe"; Description: "&Open RSProx"; Flags: postinstall sk

[InstallDelete]
; Delete the old jvm so it doesn't try to load old stuff with the new vm and crash
Type: filesandordirs; Name: "{app}\jre"
Type: filesandordirs; Name: "{app}\jdk"
; previous shortcut
Type: files; Name: "{userprograms}\RSProx.lnk"

Expand Down
6 changes: 3 additions & 3 deletions installer/native/src/linux/packr_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ int main(int argc, char** argv) {
bool loadJNIFunctions(GetDefaultJavaVMInitArgs* getDefaultJavaVMInitArgs, CreateJavaVM* createJavaVM) {

#if defined(__LP64__)
void* handle = dlopen("jre/lib/amd64/server/libjvm.so", RTLD_LAZY);
void* handle = dlopen("jdk/lib/amd64/server/libjvm.so", RTLD_LAZY);
#else
void* handle = dlopen("jre/lib/i386/server/libjvm.so", RTLD_LAZY);
void* handle = dlopen("jdk/lib/i386/server/libjvm.so", RTLD_LAZY);
#endif
if (handle == NULL) {
cerr << dlerror() << endl;
Expand Down Expand Up @@ -80,4 +80,4 @@ bool changeWorkingDir(const char* directory) {

void packrSetEnv(const char *key, const char *value) {
setenv(key, value, 1);
}
}
6 changes: 3 additions & 3 deletions installer/native/src/macos/packr_macos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ bool loadJNIFunctions(GetDefaultJavaVMInitArgs* getDefaultJavaVMInitArgs, Create
cwd.append(buf).append("/");
}

string path = cwd + "jre/lib/libjli.dylib";
string path = cwd + "jdk/lib/libjli.dylib";

void* handle = dlopen(path.c_str(), RTLD_LAZY);
if (handle == NULL) {
path = cwd + "jre/lib/jli/libjli.dylib";
path = cwd + "jdk/lib/jli/libjli.dylib";
handle = dlopen(path.c_str(), RTLD_LAZY);
if (handle == NULL) {
cerr << dlerror() << endl;
Expand Down Expand Up @@ -210,4 +210,4 @@ bool changeWorkingDir(const char* directory) {

void packrSetEnv(const char *key, const char *value) {
setenv(key, value, 1);
}
}
6 changes: 3 additions & 3 deletions installer/native/src/win32/packr_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ int main(int argc, char** argv) {
}

bool loadJNIFunctions(GetDefaultJavaVMInitArgs* getDefaultJavaVMInitArgs, CreateJavaVM* createJavaVM) {
if (!SetDllDirectory(TEXT("jre\\bin"))) {
if (!SetDllDirectory(TEXT("jdk\\bin"))) {
printLastError("SetDllDirectory");
return false;
}

LPCTSTR jvmDLLPath = TEXT("jre\\bin\\server\\jvm.dll");
LPCTSTR jvmDLLPath = TEXT("jdk\\bin\\server\\jvm.dll");

HINSTANCE hinstLib = LoadLibrary(jvmDLLPath);
if (hinstLib == nullptr) {
Expand Down Expand Up @@ -177,4 +177,4 @@ string acpToUtf8(const char *str) {
delete[] out8;

return out;
}
}
24 changes: 12 additions & 12 deletions installer/scripts/.jdk-versions.sh
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# windows x64
WIN64_VERSION=11.0.24+8
WIN64_CHKSUM=78e10f7d025898b7dc7436b2bb986570283cca3cb4a654991a4f9671231da536
WIN64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jre_x64_windows_hotspot_11.0.24_8.zip
WIN64_CHKSUM=e0181952006f9779551511d1f449ca33269a58b7b8802f001fd4ceeff2fd01f3
WIN64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jdk_x64_windows_hotspot_11.0.24_8.zip
# windows x86
WIN32_VERSION=11.0.24+8
WIN32_CHKSUM=fa9a6abdc28c4190a101ee8ab56c78426337007d391f063b9c24ec944eff80f6
WIN32_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jre_x86-32_windows_hotspot_11.0.24_8.zip
WIN32_CHKSUM=7392740f4a4176d65f279f822c35df0d9a3845cefad19c521e58c0001d929308
WIN32_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jdk_x86-32_windows_hotspot_11.0.24_8.zip
# windows aarch64
WIN_AARCH64_VERSION=11.0.24+8
WIN_AARCH64_CHKSUM=bac491e89078ba88e8a4c85fb1458c9821670126359101e555818623baf0432a
WIN_AARCH64_LINK=https://aka.ms/download-jdk/microsoft-jdk-11.0.24-windows-aarch64.zip
# mac x64
MAC_AMD64_VERSION=17.0.12+7
MAC_AMD64_CHKSUM=331aceddc402263c5e47529234965927573ead684ea2b7a0358fbb6c279c1510
MAC_AMD64_LINK=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jre_x64_mac_hotspot_17.0.12_7.tar.gz
MAC_AMD64_CHKSUM=d5230eeec88739aa7133e4c8635bbd4ab226708c12deaafa13cf26b02bc8e8c4
MAC_AMD64_LINK=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_x64_mac_hotspot_17.0.12_7.tar.gz
# mac aarch64
MAC_AARCH64_VERSION=17.0.12+7
MAC_AARCH64_CHKSUM=5c1cb2cbd2ef3f2b529e2733d0ab55381e10c4c3607f4d62f2bf12f0942198bf
MAC_AARCH64_LINK=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jre_aarch64_mac_hotspot_17.0.12_7.tar.gz
MAC_AARCH64_CHKSUM=d7910b1acaeb290c5c5da21811d2b2b8635f806612a2d6e8d1953b2f77580f78
MAC_AARCH64_LINK=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.12%2B7/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.12_7.tar.gz
# linux x64
LINUX_AMD64_VERSION=11.0.24+8
LINUX_AMD64_CHKSUM=e0c1938093da3780e4494d366a4e6b75584dde8d46a19acea6691ae11df4cda5
LINUX_AMD64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jre_x64_linux_hotspot_11.0.24_8.tar.gz
LINUX_AMD64_CHKSUM=0e71a01563a5c7b9988a168b0c4ce720a6dff966b3c27bb29d1ded461ff71d0e
LINUX_AMD64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jdk_x64_linux_hotspot_11.0.24_8.tar.gz
# linux aarch64
LINUX_AARCH64_VERSION=11.0.24+8
LINUX_AARCH64_CHKSUM=1fe97cdaad47d7d108f329c6e4560b46748ef7f2948a1027812ade0bbc2a3597
LINUX_AARCH64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jre_aarch64_linux_hotspot_11.0.24_8.tar.gz
LINUX_AARCH64_CHKSUM=04e21301fedc76841fb03929ac6cacfbbda30b5693acfd515a8f34d4a0cdeb28
LINUX_AARCH64_LINK=https://github.com/adoptium/temurin11-binaries/releases/download/jdk-11.0.24%2B8/OpenJDK11U-jdk_aarch64_linux_hotspot_11.0.24_8.tar.gz
14 changes: 7 additions & 7 deletions installer/scripts/build-linux-aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ source installer/scripts/.jdk-versions.sh
rm -rf build/linux-aarch64
mkdir -p build/linux-aarch64

if ! [ -f linux_aarch64_jre.tar.gz ] ; then
curl -Lo linux_aarch64_jre.tar.gz $LINUX_AARCH64_LINK
if ! [ -f linux_aarch64_jdk.tar.gz ] ; then
curl -Lo linux_aarch64_jdk.tar.gz $LINUX_AARCH64_LINK
fi

echo "$LINUX_AARCH64_CHKSUM linux_aarch64_jre.tar.gz" | sha256sum -c
echo "$LINUX_AARCH64_CHKSUM linux_aarch64_jdk.tar.gz" | sha256sum -c

# Note: Host umask may have checked out this directory with g/o permissions blank
chmod -R u=rwX,go=rX installer/appimage
Expand All @@ -33,12 +33,12 @@ cp installer/packr/linux-aarch64-config.json build/linux-aarch64/config.json
cp installer/appimage/rsprox.desktop build/linux-aarch64/
cp installer/appimage/rsprox.png build/linux-aarch64/

tar zxf linux_aarch64_jre.tar.gz
mv jdk-$LINUX_AMD64_VERSION-jre build/linux-aarch64/jre
tar zxf linux_aarch64_jdk.tar.gz
mv jdk-$LINUX_AMD64_VERSION-jdk build/linux-aarch64/jdk

pushd build/linux-aarch64
mkdir -p jre/lib/amd64/server/
ln -s ../../server/libjvm.so jre/lib/amd64/server/ # packr looks for libjvm at this hardcoded path
mkdir -p jdk/lib/amd64/server/
ln -s ../../server/libjvm.so jdk/lib/amd64/server/ # packr looks for libjvm at this hardcoded path

# Symlink AppRun -> RSProx
ln -s RSProx AppRun
Expand Down
14 changes: 7 additions & 7 deletions installer/scripts/build-linux-x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ source installer/scripts/.jdk-versions.sh
rm -rf build/linux-x64
mkdir -p build/linux-x64

if ! [ -f linux64_jre.tar.gz ] ; then
curl -Lo linux64_jre.tar.gz $LINUX_AMD64_LINK
if ! [ -f linux64_jdk.tar.gz ] ; then
curl -Lo linux64_jdk.tar.gz $LINUX_AMD64_LINK
fi

echo "$LINUX_AMD64_CHKSUM linux64_jre.tar.gz" | sha256sum -c
echo "$LINUX_AMD64_CHKSUM linux64_jdk.tar.gz" | sha256sum -c

# Note: Host umask may have checked out this directory with g/o permissions blank
chmod -R u=rwX,go=rX installer/appimage
Expand All @@ -33,12 +33,12 @@ cp installer/packr/linux-x64-config.json build/linux-x64/config.json
cp installer/appimage/rsprox.desktop build/linux-x64/
cp installer/appimage/rsprox.png build/linux-x64/

tar zxf linux64_jre.tar.gz
mv jdk-$LINUX_AMD64_VERSION-jre build/linux-x64/jre
tar zxf linux64_jdk.tar.gz
mv jdk-$LINUX_AMD64_VERSION-jdk build/linux-x64/jdk

pushd build/linux-x64/
mkdir -p jre/lib/amd64/server/
ln -s ../../server/libjvm.so jre/lib/amd64/server/ # packr looks for libjvm at this hardcoded path
mkdir -p jdk/lib/amd64/server/
ln -s ../../server/libjvm.so jdk/lib/amd64/server/ # packr looks for libjvm at this hardcoded path

# Symlink AppRun -> RSProx
ln -s RSProx AppRun
Expand Down
12 changes: 6 additions & 6 deletions installer/scripts/build-osx-aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ build() {
rm -rf installer/build/macos-aarch64
mkdir -p installer/build/macos-aarch64

if ! [ -f mac_aarch64_jre.tar.gz ] ; then
curl -Lo mac_aarch64_jre.tar.gz $MAC_AARCH64_LINK
if ! [ -f mac_aarch64_jdk.tar.gz ] ; then
curl -Lo mac_aarch64_jdk.tar.gz $MAC_AARCH64_LINK
fi

echo "$MAC_AARCH64_CHKSUM mac_aarch64_jre.tar.gz" | shasum -c
echo "$MAC_AARCH64_CHKSUM mac_aarch64_jdk.tar.gz" | shasum -c

mkdir -p $APPBASE/Contents/{MacOS,Resources}

Expand All @@ -29,9 +29,9 @@ build() {
cp installer/osx/Info.plist $APPBASE/Contents/
cp installer/osx/rsprox.icns $APPBASE/Contents/Resources/icons.icns

tar zxf mac_aarch64_jre.tar.gz
mkdir $APPBASE/Contents/Resources/jre
mv jdk-$MAC_AARCH64_VERSION-jre/Contents/Home/* $APPBASE/Contents/Resources/jre
tar zxf mac_aarch64_jdk.tar.gz
mkdir $APPBASE/Contents/Resources/jdk
mv jdk-$MAC_AARCH64_VERSION-jdk/Contents/Home/* $APPBASE/Contents/Resources/jdk

echo Setting world execute permissions on RSProx
pushd $APPBASE
Expand Down
12 changes: 6 additions & 6 deletions installer/scripts/build-osx-x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ build() {
rm -rf installer/build/macos-x64
mkdir -p installer/build/macos-x64

if ! [ -f mac64_jre.tar.gz ] ; then
curl -Lo mac64_jre.tar.gz $MAC_AMD64_LINK
if ! [ -f mac64_jdk.tar.gz ] ; then
curl -Lo mac64_jdk.tar.gz $MAC_AMD64_LINK
fi

echo "$MAC_AMD64_CHKSUM mac64_jre.tar.gz" | shasum -c
echo "$MAC_AMD64_CHKSUM mac64_jdk.tar.gz" | shasum -c

mkdir -p $APPBASE/Contents/{MacOS,Resources}

Expand All @@ -29,9 +29,9 @@ build() {
cp installer/osx/Info.plist $APPBASE/Contents/
cp installer/osx/rsprox.icns $APPBASE/Contents/Resources/icons.icns

tar zxf mac64_jre.tar.gz
mkdir $APPBASE/Contents/Resources/jre
mv jdk-$MAC_AMD64_VERSION-jre/Contents/Home/* $APPBASE/Contents/Resources/jre
tar zxf mac64_jdk.tar.gz
mkdir $APPBASE/Contents/Resources/jdk
mv jdk-$MAC_AMD64_VERSION-jdk/Contents/Home/* $APPBASE/Contents/Resources/jdk

echo Setting world execute permissions on RSProx
pushd $APPBASE
Expand Down
10 changes: 5 additions & 5 deletions installer/scripts/build-win-aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ source installer/scripts/.jdk-versions.sh
rm -rf installer/build/win-aarch64
mkdir -p installer/build/win-aarch64

if ! [ -f win-aarch64_jre.zip ] ; then
curl -Lo win-aarch64_jre.zip $WIN_AARCH64_LINK
if ! [ -f win-aarch64_jdk.zip ] ; then
curl -Lo win-aarch64_jdk.zip $WIN_AARCH64_LINK
fi

echo "$WIN_AARCH64_CHKSUM win-aarch64_jre.zip" | sha256sum -c
echo "$WIN_AARCH64_CHKSUM win-aarch64_jdk.zip" | sha256sum -c

unzip win-aarch64_jre.zip
unzip win-aarch64_jdk.zip
jlink \
--compress 2 \
--strip-debug \
--no-header-files \
--no-man-pages \
--output installer/build/win-aarch64/jre \
--output installer/build/win-aarch64/jdk \
--module-path jdk-$WIN_AARCH64_VERSION/jmods \
--add-modules java.base \
--add-modules java.compiler \
Expand Down
10 changes: 5 additions & 5 deletions installer/scripts/build-win32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ source installer/scripts/.jdk-versions.sh
rm -rf installer/build/win-x86
mkdir -p installer/build/win-x86

if ! [ -f win32_jre.zip ] ; then
curl -Lo win32_jre.zip $WIN32_LINK
if ! [ -f win32_jdk.zip ] ; then
curl -Lo win32_jdk.zip $WIN32_LINK
fi

echo "$WIN32_CHKSUM win32_jre.zip" | sha256sum -c
echo "$WIN32_CHKSUM win32_jdk.zip" | sha256sum -c

cp installer/native/build-x86/src/Release/RSProx.exe installer/build/win-x86/
cp rsprox-launcher.jar installer/build/win-x86/
cp installer/packr/win-x86-config.json installer/build/win-x86/config.json
cp installer/liblauncher/build32/Release/launcher_x86.dll installer/build/win-x86/

unzip win32_jre.zip
mv jdk-$WIN32_VERSION-jre installer/build/win-x86/jre
unzip win32_jdk.zip
mv jdk-$WIN32_VERSION-jdk installer/build/win-x86/jdk

echo RSProx.exe 32bit sha256sum
sha256sum installer/build/win-x86/RSProx.exe
Expand Down
10 changes: 5 additions & 5 deletions installer/scripts/build-win64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ source installer/scripts/.jdk-versions.sh
rm -rf installer/build/win-x64
mkdir -p installer/build/win-x64

if ! [ -f win64_jre.zip ] ; then
curl -Lo win64_jre.zip $WIN64_LINK
if ! [ -f win64_jdk.zip ] ; then
curl -Lo win64_jdk.zip $WIN64_LINK
fi

echo "$WIN64_CHKSUM win64_jre.zip" | sha256sum -c
echo "$WIN64_CHKSUM win64_jdk.zip" | sha256sum -c

cp installer/native/build-x64/src/Release/RSProx.exe installer/build/win-x64/
cp rsprox-launcher.jar installer/build/win-x64/
cp installer/packr/win-x64-config.json installer/build/win-x64/config.json
cp installer/liblauncher/build64/Release/launcher_amd64.dll installer/build/win-x64/

unzip win64_jre.zip
mv jdk-$WIN64_VERSION-jre installer/build/win-x64/jre
unzip win64_jdk.zip
mv jdk-$WIN64_VERSION-jdk installer/build/win-x64/jdk

echo RSProx.exe 64bit sha256sum
sha256sum installer/build/win-x64/RSProx.exe
Expand Down

0 comments on commit 82fc66d

Please sign in to comment.