#!/bin/sh

#
# jpdfbookmarks
#
# Copyright (c) 2010 Flaviano Petrocchi <flavianopetrocchi at gmail.com>.
# Copyright (c) 2025 Paulina Laura Emilia
# All rights reserved.
#
# This file is part of JPdfBookmarks.
#
# JPdfBookmarks is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# JPdfBookmarks is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with JPdfBookmarks.  If not, see <http://www.gnu.org/licenses/>.
#

jar_name=jpdfbookmarks.jar
jvm_options='-Xms64m -Xmx512m'

script_dir=$(readlink -f -- "$(dirname -- "$0")")/../share/jpdfbookmarks

# Do not show splash screen if a command line switch is passed
for arg; do
	case $arg in
	--)	break ;;
	-*)	jvm_options="$jvm_options -splash:"
		break
	esac
done

if [ -n "$JAVA_HOME" ]; then
	exec "$JAVA_HOME/bin/java" $jvm_options -jar "$script_dir/$jar_name" "$@"
else
	exec java $jvm_options -jar "$script_dir/$jar_name" "$@"
fi
