Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Sunday, 24 May 2015

Where is java on Mac Mavericks?

Sometimes you just need to know where java is on the system. I still struggle with this sort of thing on a Mac. So, for my own sanity in future, here is what I found:

Java seems to be put in different places depending on whether you've installed the JRE or the JDK, and also depending on what version you are looking for.

JRE

I recently installed just the JRE for java 1.8.0_40 using the dmg from Oracle. (Ye olde double-click and install method.) This placed java under:

/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/

JDK

Find the jdks on the system with:

/usr/libexec/java_home

or

/usr/libexec/java_home -v 1.8

found a directory where my jdks (previously installed) were located. These were under:

/Library/Java/JavaVirtualMachines/

Meanwhile, java 1.6 sdk is sitting under

/System/Library/Java/JavaVirtualMachines/

Setting the default jdk system wide

 (Answer provided by Hughes M. on https://stackoverflow.com/questions/21964709/how-to-set-or-change-the-default-java-jdk-version-on-os-x)
  • leave all JDKs at their default location, under /Library/Java/JavaVirtualMachines. The system will pick the highest version by default.
  • To exclude a JDK from being picked by default, rename its Contents/Info.plist to Info.plist.disabled. That JDK can still be used when $JAVA_HOME points to it, or explicitly referenced in a script or configuration. It will simply be ignored by system's java command.
System launcher will use the JDK with highest version among those that have an Info.plist file.
When working in a shell with alternate JDK, pick your method among existing answers (jenv, or custom aliases/scripts around /usr/libexec/java_home, etc).

 

Setting the default jdk - in a one-off sense

Locate the java versions on the system (see above).

export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_121`

 or, if the version is unique, you could use

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

But don't do that second version if you are planning on having later versions installed but not the default.


Saturday, 5 July 2014

Mac - ironing out the little things

I just got a new Mac. This page is just to store the notes on things I had to do to get things working the way I wanted, or working at all.

Two finger scrolling


At first, I had no problems scrolling up and down in browser using the two finger scrolling action. Then suddenly it stopped working in Firefox although it worked in other applications that I happened to have open. I read some advice about turning off the smooth scrolling option in Firefox under Preferences | Advanced, but that made no difference.

The solution was to follow the advice in this video posted by Anson Alexander where I had to go to

System Preferences | Trackpad | More gestures

and turn off the option to Swipe between pages.

I definitely value up and down scrolling on a page far beyond swiping left and right, so if this is the price to pay to keep that working, so be it.

Thank you for the solution, Anson!