0

Ubuntu: 14.04.4 LTS
Java Version: 1.8.0_74

I installed Jstock (1.0.7.13) via this: http://jstock.org/help_install_upgrade.html#install-linux
So I start the programm via ./jstock.sh

When I start Jstock I get:

Warning: /usr/bin does not exist

Then the program starts.

Even if the folder obviously exist, and also I found /usr/share/java, so this also exists.
When I type whereis java it says:

java: /usr/bin/java /usr/bin/X11/java /usr/share/java /usr/share/java /usr/share/man/man1/java.1.gz

The jstock.sh file says:

#!/bin/bash
#
# Normally, editing this script should not be required.
# Only case is to set up JAVA_HOME if it's not already defined.
#
# To specify an alternative JVM, edit and uncomment the following 
# line and change the path accordingly.
#JAVA_HOME=/usr/share/java

_JAVA_EXEC="java"
if [ -n $JAVA_HOME ] ; then
    _TMP="$JAVA_HOME/usr/bin"
    if [ -f "$_TMP" ] ; then
        if [ -x "$_TMP" ] ; then
            _JAVA_EXEC="$_TMP"
        else
            echo "Warning: $_TMP is not executable"
        fi
    else
        echo "Warning: $_TMP does not exist"
    fi
fi
if ! which "$_JAVA_EXEC" >/dev/null ; then
    echo "Error: No Java Runtime Environment found"
    echo "Please set the environment variable JAVA_HOME to the root       directory of your SUN Java installation, e.g. by editing the 7th line in this     launcher script."
    exit 1
fi

#
# Resolve the location of the JStock installation.
# This includes resolving any symlinks.
PRG=$0
while [ -h "$PRG" ]; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '^.*-> \(.*\)$' 2>/dev/null`
    if expr "$link" : '^/' 2> /dev/null >/dev/null; then
        PRG="$link"
    else
        PRG="`dirname "$PRG"`/$link"
    fi
done

JSTOCK_BIN=`dirname "$PRG"`
cd "${JSTOCK_BIN}"

_VMOPTIONS="-Xms64m -Xmx512m"
$_JAVA_EXEC $_VMOPTIONS -jar jstock.jar

The program works fine, but since I want to use it in reality I want the program to fully function, without any error.

btw: How can I write here like a normal human being? I made weird spaces to avoid writing everything in one line. Thx !

1

Changing the line _TMP="$JAVA_HOME/usr/bin to _TMP="$JAVA_HOME/usr/bin/java works for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.