1

I am trying to get Janusgraph working on OpenSuse Leap 42.3 but I'm running into a multitude of problems.

My understanding is that JanusGraph invokes other Java dependencies, including gremlin & cassandra. I've tried from my account and from root but I gather from subsequent reading that running janusgraph.sh from root is either deprecated or impossible.

I think that my Java environment variables are wrong and and running env reveals a bunch of variables relating to java and I don't know how or where they're generated or declared. I'd like to set these up in way that they're common across ALL accounts, which I think may be possible somehow, using /etc/environment?

Here's the output from env | grep J + other manual extracts (all the following are run from my normal bash account, not root)

JRE_HOME=/usr/lib64/jvm/jre-1.8.0-openjdk/jre/bin/java
JAVA_BINDIR=/usr/lib64/jvm/java/bin
JAVA_HOME=/usr/bin/
JDK_HOME=/usr/lib64/jvm/java
JAVA_ROOT=/usr/lib64/jvm/java
CASSANDRA_HOME=/opt/apache-cassandra-3.11.3/bin/
PATH=/home/me/adb-fastboot/platform-tools:/home/me/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/home/me/bin:/usr/lib64/jvm/jre-1.8.0-openjdk/bin/java:/usr/lib64/jvm/jre-1.8.0-openjdk/jre/bin/java:/usr/bin/

but I think that contradicts:

alternatives --list java
/usr/lib64/jvm/jre-1.8.0-openjdk/bin/java

I've also checked:

java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (IcedTea 3.10.0) (build 1.8.0_191-b12 suse-30.1-x86_64)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

and to bottom out the actual location:

readlink -f /usr/bin/java
/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin/java

and

whereis java
java: /usr/bin/java /usr/lib64/java /etc/java /usr/share/java /usr/share/man/man1/java.1.gz
  • me@machinename:/opt/janusgraph-0.2.2-hadoop2/bin> ./gremlin.sh ./gremlin.sh: line 133: /usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/jre/bin//bin/java: No such file or directory, for example! The point of the question is the paragraph in bold and I didn't think my environment was OK, but if it is I don't know how I get the path issue returned on trying to run gremlin.sh – Greg Feb 10 at 19:49
  • Next time please include the errors, then. Thanks for the input. – Rui F Ribeiro Feb 10 at 20:32
  • Thanks Rui. If I'd felt that was possible I would have done, but I tried so many different approaches and got different results, some of which looked like they worked until I tried another step, only to find it hadn't. There is an exponential set of combinations and context explanations that would have made an answer impossible. As it was, Freddy took a holistic approach that sorted me out. Thanks for your input though. – Greg Feb 11 at 20:40
1

Your PATH variable is messed up and I don't know why you should need JRE_HOME, JAVA_BINDIR, JDK_HOME and JAVA_ROOT. Generally you will only need the java binary in your PATH and the JAVA_HOME variable. But maybe your setup requires some of these, so I would suggest you leave them until your environment works as desired.

Allow me to dissect your PATH, remove the entries with comments:

PATH=/home/me/adb-fastboot/platform-tools:
/home/me/bin:
/usr/local/bin:
/usr/bin:
/bin:
/usr/bin/X11:
/usr/games:
/home/me/bin: # remove, already defined above
/usr/lib64/jvm/jre-1.8.0-openjdk/bin/java: # remove, java is already in /usr/bin
/usr/lib64/jvm/jre-1.8.0-openjdk/jre/bin/java: # remove, java is already in /usr/bin
/usr/bin/ # remove, already defined above

Your new PATH is:

PATH=/home/me/adb-fastboot/platform-tools:/home/me/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games

JAVA_HOME/JRE_HOME should be:

JAVA_HOME=/usr/lib64/jvm/jre-1.8.0-openjdk
JRE_HOME=$JAVA_HOME/jre

Edit: Your variables are probably exported in your ~/.bashrc or ~/.profile. Make the changes where you find them (with export before the variable name).

  • Thanks, I'll try out your suggestion and report back. Incidentally, in OpenSuse, I've found a script /etc/profile.d/alljava.sh which seems to make/adjust some Java environment variables. (export JAVA_BINDIR = $JPATH/bin, export JAVA_ROOT=$JPATH, export JAVA_HOME=$JPATH, unset JDK_HOME, unset SDK_HOME and more (keeping this shortish). Is this an area to avoid or keep in mind? – Greg Feb 10 at 20:39
  • Yes, this looks like the place, but I can't tell you where "alljava.sh" comes from (OpenSuse?) and why the installation is broke. I prefer to add the variables to my ~/.bashrc, but that's just my preference. From what it looks like, set JAVA_ROOT to the same value as JAVA_HOME (export JAVA_ROOT=$JAVA_HOME) and export JAVA_BINDIR=$JAVA_HOME/bin – Freddy Feb 10 at 20:48
  • Yes, judging from the script header, it's an OpenSuse script to normalise all the main Java environment variables. I can paste it in, if it's useful to anyone? I'm going to follow your advice and rationalise my bash .profile for my account but it would still be useful to understand how to set up the whole system, so it's the same for all users, including root (I guess) – Greg Feb 10 at 22:22
  • I cleaned out all my manually added Java environment variables and additions to PATH, in .profile and rebooted - I would have logged out/in but I wasn't sure whether the alljava.sh script was pre or post login, so it seemed easier just to reboot (it's my desktop not a publicly available server). Thanks for the pointers :) – Greg Feb 10 at 23:02
  • Cool. Now you can start to eliminate all variables you don't really need. Or maybe tomorrow... :) – Freddy Feb 10 at 23:05

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.