Skip to content

Commit 962067f

Browse files
committed
Mike updated his script for enabling OS X Java-based desktop apps to use the Oracle Java JDK
Mike updated his script for enabling OS X Java-based desktop apps to use the current Oracle Java JDK in place of Apple’s Java 6.
1 parent 18bad01 commit 962067f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

rtrouton_scripts/update_oracle_java_jdk_jvmcapabilities/update_oracle_java_jdk_jvmcapabilities.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/python
2-
import plistlib, os.path
2+
import plistlib, os.path, os
33

44
# Based off of https://forums.developer.apple.com/message/6741
5+
# and http://apple.stackexchange.com/a/136976
56

67
def jdk_info_plists():
78
# Find all the JDK Info.plist files
@@ -27,3 +28,21 @@ def jdk_info_plists():
2728
info['JavaVM']['JVMCapabilities'] = sorted(capabilities)
2829
# Write back our changes
2930
plistlib.writePlist(info, info_plist)
31+
# Create a symlink to fix legacy applications
32+
# Find the Contents directory
33+
contents_path = os.path.dirname(info_plist)
34+
# make the bundle/Libraries subpath
35+
bundle_libraries = os.path.join(contents_path, "Home", "bundle", "Libraries")
36+
try:
37+
# Just in case you run this script multiple times, we'll fail if the directory already exists
38+
os.makedirs(os.path.join(bundle_libraries))
39+
except:
40+
pass
41+
# create the symlink between libjvm.dylib and libserver.dylib
42+
libjvm_dylib = os.path.join(contents_path, "Home", "jre", "lib", "server", "libjvm.dylib")
43+
libserver_dylib = os.path.join(bundle_libraries, "libserver.dylib")
44+
try:
45+
# Just in case you run this script multiple times, we'll fail if the file already exists
46+
os.symlink(libjvm_dylib, libserver_dylib)
47+
except:
48+
pass

0 commit comments

Comments
 (0)