<commit_before>#!/bin/bash

echo "$1"

if [ -z "$1" ]
  then
    echo "Specify a Java version to set up"
    exit 1
fi

unlinkjava () {
  sudo unlink /usr/bin/java
  sudo unlink /usr/bin/javac
  sudo unlink /usr/bin/javadoc
  sudo unlink /usr/bin/javah
  sudo unlink /usr/bin/javap
}

if [ $1 == 7 ]
  then 
    echo "Setting up Java 7"
    unlinkjava
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/java /usr/bin/java
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/javac /usr/bin/javac
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/javadoc /usr/bin/javadoc
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/javah /usr/bin/javah
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home/bin/javap /usr/bin/javap
fi

if [ $1 == 8 ]
  then
    echo "Setting up Java 8"
    unlinkjava
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/java /usr/bin/java
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/javac /usr/bin/javac
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/javadoc /usr/bin/javadoc
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/javah /usr/bin/javah
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home/bin/javap /usr/bin/javap
fi<commit_msg>Update 20-java-version-switch.sh<commit_after>#!/bin/bash

echo "$1"

if [ -z "$1" ]
  then
    echo "Specify a Java version to set up"
    exit 1
fi

unlinkjava () {
  sudo unlink /usr/bin/java
  sudo unlink /usr/bin/javac
  sudo unlink /usr/bin/javadoc
  sudo unlink /usr/bin/javah
  sudo unlink /usr/bin/javap
}

if [ $1 == 10 ]
  then 
    echo "Setting up Java 10"
    unlinkjava
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/bin/java /usr/bin/java
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/bin/javac /usr/bin/javac
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/bin/javadoc /usr/bin/javadoc
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/bin/javah /usr/bin/javah
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk-10.0.2.jdk/Contents/Home/bin/javap /usr/bin/javap
fi

if [ $1 == 8 ]
  then
    echo "Setting up Java 8"
    unlinkjava
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/java /usr/bin/java
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/javac /usr/bin/javac
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/javadoc /usr/bin/javadoc
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/javah /usr/bin/javah
    sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home/bin/javap /usr/bin/javap
fi
{'fraction_non_alphanumeric': 0.137642330877428, 'fraction_numerical': 0.04253181513730744, 'mean_word_length': 2.9773635153129163, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6516627', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1226, 'n_words': 212}