Skip to content

Instantly share code, notes, and snippets.

@ronanguilloux
Created October 28, 2015 17:10
Show Gist options
  • Save ronanguilloux/897a3a682f0be1b2cddd to your computer and use it in GitHub Desktop.
Save ronanguilloux/897a3a682f0be1b2cddd to your computer and use it in GitHub Desktop.
Brew-installed BaseXGUI launch script w/ better RAM allocation
#! /bin/bash
#
# basex.sh
# Copyright (C) 2015 ronan <ronan@cider>
#
# Distributed under terms of the MIT license.
#
#!/bin/bash
# Path to this script
FILE="${BASH_SOURCE[0]}"
while [ -h "$FILE" ] ; do
SRC="$(readlink "$FILE")"
FILE="$( cd -P "$(dirname "$FILE")" && \
cd -P "$(dirname "$SRC")" && pwd )/$(basename "$SRC")"
done
#BX="$( cd -P "$(dirname "$FILE")/.." && pwd )"
BX="/usr/local/Cellar/basex/8.3/libexec"
# Core and library classes
CP="$BX/BaseX.jar"
CP="$CP$(for JAR in "$BX"/lib/*.jar; do echo -n ":$JAR"; done)"
# Options for virtual machine
#VM=-Xmx512m
VM=-Xmx1024m
# Run code
java -cp "$CP" $VM org.basex.BaseXGUI "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment