-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdkman-darwin-setup
executable file
·26 lines (24 loc) · 1.06 KB
/
sdkman-darwin-setup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh
mkdir -p "$HOME/Library/Java/JavaVirtualMachines/sdkman-current/Contents"
ln -si $HOME/.sdkman/candidates/java/current "$HOME/Library/Java/JavaVirtualMachines/sdkman-current/Contents/Home"
echo "<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>sdkman.current</string>
<key>CFBundleName</key>
<string>SDKMAN Current JDK</string>
<key>JavaVM</key>
<dict>
<key>JVMPlatformVersion</key>
<string>9999</string>
<key>JVMVendor</key>
<string>Homebrew</string>
<key>JVMVersion</key>
<string>9999</string>
</dict>
</dict>
</plist>" > "$HOME/Library/Java/JavaVirtualMachines/sdkman-current/Contents/__tmp"
mv -i "$HOME/Library/Java/JavaVirtualMachines/sdkman-current/Contents/__tmp" "$HOME/Library/Java/JavaVirtualMachines/sdkman-current/Contents/Info.plist"
rm "$HOME/Library/Java/JavaVirtualMachines/sdkman-current/Contents/__tmp" 2>/dev/null