vmware/weathervane

weathervane and java

lidiawarnes opened this issue · 1 comments

On one of the nodes where I an trying to setup weathervane I had java11. This version is not recognized by weathervane. To run the gradlew script which creates the /dist directory I had to install java 8 since 11 is not a recognized revision. I uninstalled java 11 and I changed the JAVA_HOME path and the java alternatives to point to the correct version. The autosetup.pl script also goes through an "installing Java" step. I think this is how I ended up with 2 versions of java 8 on my machine: java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64 and java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64-debug

Also, I think that a weathervane script updates JAVA_HOME in ~/.bashrc at boot time because it always gets set to export JAVA_HOME=/usr/lib/jvm/java-1.8.0 - please confirm.

With 2 Java versions the weathervane.pl script will fail even when I set the java alternatives which look as follows:
#############
update-alternatives --config java

There are 2 programs which provide 'java'.

Selection Command

  • 1 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64/jre/bin/java)
  • 2 java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.212.b04-0.el7_6.x86_64-debug/jre/bin/java)
    ##############

To work around the problem, I currently update JAVA_HOME in ~/.bashrc after every reboot. I would like to apply a more elegant fix but to do so I think I need to understand which script sets JAVA_HOME at boot time.