Skip to content

Instantly share code, notes, and snippets.

@mojavelinux
Created January 8, 2017 03:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mojavelinux/29ec4f7dc668e0adba14ba91732b3f97 to your computer and use it in GitHub Desktop.
Save mojavelinux/29ec4f7dc668e0adba14ba91732b3f97 to your computer and use it in GitHub Desktop.
A portable way to get the install path of the current JDK.
#!/bin/sh
jrunscript -e 'print(java.lang.System.getProperty("java.home").replaceAll("\\"+java.io.File.separator+"jre$",""))'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment