2

I have multiple Java Versions installed and want to run a packaged application (JabRef) with a specific version at /Library/Java/JavaVirtualMachines/zulu-8.jdk which is not JAVA_HOME.

If I would run the .jar directly, I could just specify the version. However, in my case the App is packaged in an .app package. Is there a way to simply modify the application to use a specific java jdk?

The Info.plist looks the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBundleName</key>
<string>JabRef</string>
<key>CFBundleExecutable</key>
<string>JavaApplicationStub</string>
<key>CFBundleIconFile</key>
<string>app.icns</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleIdentifier</key>
<string>com.install4j.0034-7691-1464-4754.23</string>
<key>CFBundleVersion</key>
<string>5.0-dev--snapshot--2019-07-29--master--f6eb5344a</string>
<key>CFBundleShortVersionString</key>
<string>5.0-dev--snapshot--2019-07-29--master--f6eb5344a</string>
<key>CFBundleGetInfoString</key>
<string>5.0-dev--snapshot--2019-07-29--master--f6eb5344a</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>NSHighResolutionCapable</key>
<true/>
<key>LSHasLocalizedDisplayName</key>
<true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
<!-- I4J_INSERT_DOCTYPE -->
<key>i4j.baseDir</key>
<string>$APP_PACKAGE/Contents/Resources/app/</string>
<key>LSMinimumSystemVersion</key>
<string>10.7.3</string>
<key>i4j.appId</key>
<string>0034-7691-1464-4754</string>
<key>i4j.allowPassthrough</key>
<true/>
<key>i4j.minVersion</key>
<string>1.8</string>
<key>i4j.maxVersion</key>
<string>1.8</string>
<key>i4j.vmIdPrefix</key>
<string></string>
<key>JavaVM</key>
<dict>
<key>MainClass</key>
<string>com.install4j.runtime.launcher.MacLauncher</string>
<key>VMOptionArray</key>
<array>
<string>-Dfile.encoding=UTF-8</string>
<string>-Dinstall4j.launcherId=23</string>
<string>-Dinstall4j.swt=false</string>
<string>-Dexe4j.moduleName=$APP_PACKAGE</string>
</array>
<key>OptionsFile</key>
<string>$APP_PACKAGE/Contents/vmoptions.txt</string>
<key>ArgumentArray</key>
<array>
</array>
<key>SearchSequence</key>
<array>
<string>EPATH</string>
<string>Y</string>
<string>EJAVA_HOME</string>
<string>EJDK_HOME</string>
</array>
<key>VersionInfo</key>
<string>0_512474297</string>
<key>ClassPath</key>
<string>$APP_PACKAGE/Contents/Resources/app/.install4j/i4jruntime.jar:$APP_PACKAGE/Contents/Resources/app/JabRef-5.0-dev--snapshot--2019-07-29--master--f6eb5344a.jar</string><!-- I4J_INSERT_CLASSPATH -->
<key>WorkingDirectory</key>
<string>$APP_PACKAGE/Contents/Resources/app/.</string>
</dict>
</dict>
</plist>
  • What is in the Info.plist of the app? – user151019 Jul 31 at 14:13
  • @Mark I added the file. – McLawrence Jul 31 at 14:21
  • The best answer would be to alter the parameters to the installer to change the VM. However the information might be in $APP_PACKAGE/Contents/vmoptions.txt – user151019 Jul 31 at 14:24
  • the vmoptions.txt contains only three lines: -XX:+UseG1GC -XX:+UseStringDeduplication -XX:StringTableSize=1000003. What would I have to add? – McLawrence Jul 31 at 14:28
  • 1
    You need to look at how install4j works as it downloads the V M if needed . So best to ask on the JabRef support web pages. – user151019 Jul 31 at 15:49

You must log in to answer this question.

Browse other questions tagged .