MacOS – How to find rt.jar file

finderjavamacos

My virus scanner (Sophos) showed that it was scanning a file named rt.jar plus several other .jar files. I was a little bit surprised because I didn't think that Java was installed.

Yet, when I search using Finder, I can't find any indication that this or any other .jar file exists on my system (OSX 10.10).

Any suggestions about where/how to look?

Best Answer

The best way to find files is through Terminal. You don't need to download or install any extra applications.

Simply issue the command:

sudo find / -name rt.jar

It will ask your for your password; enter it. Find will go through all of your directories and when it finds any instances of "rt.jar" it will output the directory to your screen. You can then navigate to that directory via finder or through the terminal via the "cd" command

cd /the/path/where/find/located/your/file

you can delete it if you like with the "rm" command

rm rt.jar

If you want to see files in Finder just issue these commands in Terminal:

defaults write com.apple.finder AppleShowAllFiles TRUE; killall Finder

After that, you will be able to search and view all of the hidden files.

If you want to go back to the default view just change the "TRUE" to "FALSE"

defaults write com.apple.finder AppleShowAllFiles FALSE;killall Finder