Monday, October 26, 2015

Updating to El Capitan and suddenly Maven is not working

I'm using IntelliJ IDE and when I updated to El Capitan version of OSX, I started getting this irritating pop out error in the IDE "can't start git: /usr/bin/git". I looked for a solution, and then I found this website: JetBrains Support

The solution is basically to install xcode (if you still don't have it) and agree to the licenses by running "sudo xcodebuild -license" in your terminal.

So, everything works well, I should be able to work properly the next day. And when I tried running my Selenium WebDriver scripts, my JAVA_HOME can't be found by Maven! So I need to search for a way to define my JAVA_HOME with minimal updates to the system (that's always the best way so you won't get confused when you want or need to update it).

I found this thread in stackoverflow.com and below is the solution that I did.

  1. In your home directory: (/Users/{username})
  2. nano .bash_profile and add the line below :
    export
    JAVA_HOME=/Library/Java/JavaVirtualMachines/1.6.0_31-b04-413.jdk/Contents/Home`
  3. Make sure the path "/Library/Java/JavaVirtualMachines/1.6.0_31-b04-413.jdk/Contents/Home" exist.