Skip to content
Özgün Babur edited this page Jan 9, 2021 · 5 revisions

This guide is now expired. Unfortunately, ChiBE is not compatible with Mac after the OS version 10.15 (Catalina). Please use virtual environments to run either Linux or Windows version of ChiBE on MacOS.


ChiBE Setup Instructions (for MAC OS X versions prior to Catalina) using jenv to manage multiple java installations, as originally prepared by Abbie Jones and Hannah Manning


While running ChiBE is straightforward on Linux and Windows, running on Mac requires several extra steps. This is because ChiBE depends on external libraries that cannot run on a 64 bit JVM on Mac. And unfortunately, Mac designers decided to not to support 32 bit Java execution starting from Java 7. As a result, ChiBE needs Java 6 on Mac, just to be able to do a 32 bit execution.

Following instructions are intended for MAC users who use Java 7 or higher. Jenv allows a user to specify which directories use which version of Java. For example, a user can use Java 10 globally, but set the ChiBE directory to Java 6.


  1. Install homebrew (if not already installed). Use the command below or explore the extended guide.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. Install jenv with homebrew.
brew install jenv
  1. Install most recent version of java with homebrew (this step probably won't be necessary for everyone, but it's good to stay up to date)
brew cask install java
  1. Install java 1.6 (steps a-d):

    a. Update homebrew if already installed:

     brew update
    

    b. allow brew to lookup versions

     brew tap homebrew/cask-versions
    

    c. list java versions

     brew search java
    

    d. install java 1.6

     brew cask install java6
    
  2. Ensure that your desired java versions are all present:

ls /Library/Java/JavaVirtualMachines/

The output should at least contain the JDKs for Java6 (needed for ChiBE) and the most recent java version. For example: 1.6.0.jdk jdk-10.0.1.jdk

  1. Important: add the following lines to your ~/.bash_profile
export PATH="$HOME/.jenv/bin:$PATH" # adds jenv to your path
eval "$(jenv init -)" # allows jenv shims
  1. Source your bash profile to put those changes into place.
source ~/.bash_profile
  1. Tell jenv that you've installed the legacy version of java:
jenv add /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home

Output should look like this:

oracle64-1.6.0.65 added
1.6.0.65 added
1.6 added
  1. install shims for newly installed versions of java:
jenv rehash
  1. Check that jenv recognizes all the versions of java that you want it to see:
jenv versions

Possible output:

* system (set by /Users/<user>/.jenv/version
1.6
1.6.0.65
oracle64-1.6.0.65
  1. It's generally a good idea to run this command, although it may not be necessary:
jenv enable-plugin export

If you have not yet downloaded ChiBE, do so now by clicking on the link for the latest Mac Build here on the github page (https://github.com/PathwayCommons/chibe) and unzipping it, or by using the following commands:

cd /Applications/
wget https://raw.githubusercontent.com/PathwayAndDataAnalysis/repo/master/chibe-builds/chibe-latest-build-macosx-x86.zip
unzip chibe-latest-build-macosx-x86.zip
  1. cd into the directory containing ChiBE.sh
cd /Applications/ChiBE/
  1. Change java path to java 1.6 for only that directory.
jenv local oracle64-1.6.0.65

NOTE1: to change to a different version of java that you've set up with jenv, replace 'oracle64-1.6.0.65' with the option of your choice, picked from the list given by this command: jenv versions

NOTE2: to change your java installation for the entire computer, use 'global' instead of 'local'. To do so just for the shell that you have open, use 'shell' instead.

  1. Verify that the version you selected is the one being used (in these instructions, “oracle64-1.6.0.65”):
jenv versions

Possible output, depending on versions you’ve installed:

system (set by /Users/<user>/.jenv/version)
1.6
1.6.0.65
* oracle64-1.6.0.65 

NOTE: The * indicates which version is being used. Try cd'ing to a different directory and checking which is the default from that location. Is it different? Try changing it back and forth.

  1. From the directory containing ChiBE.sh (which now has the java 6 set as its default), run ChiBE:
source ChiBE.sh

OR

sh ChiBE.sh

Note: if you close the terminal window while this blocking command is running, it will kill ChiBE.sh and you'll have to rerun the command. Thank you for choosing ChiBE and let us know if we can improve these instructions!

Miscellaneous check commands for your verifying pleasure:

which java
jenv which java
java versions
echo $JAVA_HOME

It is not advised to change the contents of ~/.java-version. Do so at your own risk, and only in dire circumstances.

Clone this wiki locally