A few days ago,Latest session of WWDC Conference for us EL Capitan 10.11 latest OSX system,The first time I installed a developer preview。Without him,Netizens have said very little bug is the forums。Looking back to the year,When upgrading from 10.9 and 10.10,Even in beta stage,Is still flying bug!
But this does very little bug,Some do not even find innocuous,Really astonishing!
but,I am afraid that there is a bug inside these people have to pay attention to the,That does not support the Java SE 6,This directly led to all programs using Java are not able to run,Pit ah!
“This application requires the legacy Java SE 6 runtime which is unavailable for this version of OS X.”
Fortunately, there areOkamiIt gives a solution,Since it does not support the old Java SE 6,Then why do not directly install the latest version of Java SE 8?
Ready to work
First of all,You need to goOfficial website to downloadThe latest version of the JDK (JDK instead of JRE Why? Because JRE modification method trickier ...... its so,Not as one step。) And then install it。
Verify the version
Open a terminal,Then use the following command to view,If your results and I almost here,That explanation has been installed。
1 2 3 4 |
╰─➤ java -version java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode) |
Modify the configuration file
Please look directory,No System!
System is not in the Library!
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
找到如下路径的文件,修改之。(需要管理员权限) sudo vim /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Info.plist //找到如下字段 <key>JVMCapabilities</key> <array> <string>CommandLine</string> </array> //修改成这样: <key>JVMCapabilities</key> <array> <string>CommandLine</string> <string>JNI</string> <string>BundledApp</string> </array> |
Create link
Since the EL Capitan has a new called "RootLess" function,So we can only create a level of directory,Turn into the directory as follows,If you do not exist, create:
1 2 3 4 |
cd /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home sudo mkdir bundle cd bundle sudo mkdir Libraries |
Then use the following command to create a link (which is a command)
1 |
sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/server/libjvm.dylib /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/bundle/Libraries/libserver.dylib |
Create two empty directory
The method according to the top,We also need to create a level two empty directory:
1 2 3 4 5 6 7 8 9 10 11 |
/Library/Java/JavaVirtualMachines/1.6.0.jdk /Library/Java/Support/Deploy.bundle //为了绕过那个苦逼的 rootless,一级一级的创建才行,懒得关闭了。 cd /Library/Java/JavaVirtualMachines sudo mkdir 1.6.0.jdk cd .. sudo mkdir Support cd Support sudo mkdir Deploy.bundle |
Your actual operating environment is likely to follow my example is not the same,But similar,Note that you can work。
😰Shame it,Originally, I wrote and wrote, when he pulled the System directory! It was my fault,I apologize,It has now been corrected!
Reboot the system
At this moment,You also need the final step,Since restarting 10.11 this time will turn off,We use the command line to restart,Although it will be stuck,But it is possible to restart ......
1 |
sudo shutdown -r now |
Optimization App
More work done,Most likely you still find that the tragedy of your Java program will not start,Do not panic,Probably because the program does not support the latest version of the Java cause,We need a manual to support it:
Right-click on your application - or hold control Click the,select"Show Package Contents”,There is a directory under Content Info.plist file
1 |
完整的路径应该是这样的:/Applications/你的Java程序.app/Contents/Info.plist |
1 2 3 4 5 6 7 8 9 10 11 |
编辑这个文件,在里边找到这句话: <key>JVMVersion</key> <string>1.*</string> 做如下修改: <key>JVMVersion</key> <string>1.8*</string> |
Save it ...... you may need administrator privileges,if not,To drag out the modifications is then covered with short back ......,After editing your Java programs on ok friends
Original article written by LogStudio:R0uter's Blog » OSX 10.11 EI Capitan running Java SE 8
Reproduced Please keep the source and description link:https://www.logcg.com/archives/1027.html
Apple has released JavaForOSX2015-001.dmg: https://support.apple.com/kb/DL1572?locale=en_US
Download the installation can be solved OS X EI Capitan open the App prompted this Application requires the legacy Java SE 6 runtime issues。
Yes,This can also solve the problem。But I have installed java8,Do not cover the back,But this is indeed more convenient to solve the problem ~
When you create a step 1.6.0.jdk and Deploy.bundle,I encountered a problem,In the / System / Library / Java / Extensions path only two directories and Support,No JavaVirtualMachine directory。When prompted to create mkdir command via sudo mkdir JavaVirtualMachine: JavaVirtualMachines: Operation not permitted error。I do not know what the situation。
You are going the wrong way,Please go left ~
No system,You go to the wrong directory permissions of course not!
Your article has / System / directory at this level oh
Turned out to be true! I have a directory behind even really wrong! Strange little wonder so many people。。。。。I have corrected guilt ......。Please castigate me!
I'm just looking