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
67def 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