21

Currently running OSX El Capitan on a recently set up computer. I'm trying to set up Java's unlimited crypto policy which requires me to modify some files within my current jre, but I can't find the Java folder that is supposed to be located within Library.

I've run /usr/libexec/java_home which shows me /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home however within my Library folder, there is no Java folder, even when I try and navigate through terminal it says Java folder doesn't exist. After trying to reinstall JDK 1.8, still no luck and I'm out of ideas.

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Tyler
  • 310
  • 1
  • 2
  • 6

2 Answers2

52

This is not the Library folder in your home directory, this is the Library folder in the root file system on your main disk.

So in Terminal the command

cd /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk

should work.

For different releases of Java replace jdk1.8.0_91.jdk with the appropriate release.

To list what is in the directory use:

ls /Library/Java/JavaVirtualMachines
greg-449
  • 109,219
  • 232
  • 102
  • 145
  • 1
    I got `cd: no such file or directory: /Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk ` Please help me to find Java Home. – Harsha May 27 '21 at 16:29
  • @Harsha You have to replace `jdk1.8.0_91.jdk` with whatever your actual Java release is. Use `ls /Library/Java/JavaVirtualMachines` to list which jdks are installed – greg-449 May 27 '21 at 16:33
1

Go to Macintosh HD/Library/Java not to username/Library

Chadi Rahme
  • 21
  • 1
  • 2
  • This was already explained in the first sentence of the accepted answer. – Eric Aya Oct 12 '21 at 18:46
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 13 '21 at 03:51