Mac查找java主目录

找了半天终于找到,可以通过命令行直接拿到主目录

$ /usr/libexec/java_home -V  
Matching Java Virtual Machines (3):  
    1.7.0_45, x86_64:   "Java SE 7" /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home  
    1.6.0_65-b14-462, x86_64:   "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home  
    1.6.0_65-b14-462, i386: "Java SE 6" /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home  
  
/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home  

 

posted @ 2017-04-13 02:40  jagger123  阅读(574)  评论(0编辑  收藏  举报