Skip to content

Instantly share code, notes, and snippets.

@ffbit
Created August 3, 2012 10:20
Show Gist options
  • Save ffbit/3246464 to your computer and use it in GitHub Desktop.
Save ffbit/3246464 to your computer and use it in GitHub Desktop.
Determining JAVA_HOME environment variable on fly
#!/bin/bash
java_path=$(readlink -f `which java`)
export JAVA_HOME=$(dirname `dirname $java_path`)
export PATH=$PATH:$JAVA_HOME/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment