How to set JAVA_HOME in Mac permanently?

You can use /usr/libexec/java_home -v <version you want> to get the path you need for JAVA_HOME. For instance, to get the path to the 1.7 JDK you can run /usr/libexec/java_home -v 1.7 and it will return the path to the JDK. In your .profile or .bash_profile just add export JAVA_HOME=`/usr/libexec/java_home -v <version>` and you should … Read more

Should JAVA_HOME point to JDK or JRE?

If you’re doing any sort of development, or building with Maven or Ant, you need to point to the JDK (Java Development Kit) where utilities such as javac (the Java Compiler) reside. Otherwise, you can point to the JRE (Java Runtime Environment). The JDK contains everything the JRE has and more. If you’re just executing … Read more

How can I change Mac OS’s default Java VM returned from /usr/libexec/java_home

I think JAVA_HOME is the best you can do. The command-line tools like java and javac will respect that environment variable, you can use /usr/libexec/java_home -v ‘1.7*’ to give you a suitable value to put into JAVA_HOME in order to make command line tools use Java 7. export JAVA_HOME=”`/usr/libexec/java_home -v ‘1.7*’`” But standard double-clickable application … Read more

Make $JAVA_HOME easily changable in Ubuntu [closed]

Put the environment variables into the global /etc/environment file: … export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun … Execute “source /etc/environment” in every shell where you want the variables to be updated: $ source /etc/environment Check that it works: $ echo $JAVA_HOME $ /usr/lib/jvm/java-1.5.0-sun Great, no logout needed. If you want to set JAVA_HOME environment variable in only the terminal, … Read more

How to set Oracle’s Java as the default Java in Ubuntu?

I put the line: export JAVA_HOME=/usr/lib/jvm/java-7-oracle in my ~/.bashrc file. /usr/lib/jvm/java7-oracle should be a symbolic link pointing to /usr/lib/jvm/java-7-oracle-[version number here]. The reason it’s a symbolic link is that in case there’s a new version of the JVM, you don’t need to update your .bashrc file, it should automatically point to the new version. If … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)