No JRE_HOME or JAVA_HOME environment variable is set

James Griffin July 5, 2018

Hi,

Im using CentOS 7.

I installed JIRA from the .bin file 

sudo mkdir /opt/atlassian
cd /opt/atlassian/

sudo wget https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.9.2-x64.binsudo chmod +x atlassian-jira-software-7.9.2-x64.bin

sudo ./atlassian-jira-software-7.9.2-x64.bin

 

Im trying to setup HTTPS following this link

https://confluence.atlassian.com/adminjiraserver073/running-jira-applications-over-ssl-or-https-861253906.html

I am trying to run config.sh

cd /opt/atlassian/jira/bin

./config.sh

 

I get the error

No JRE_HOME or JAVA_HOME environment variable is set - attempting to just run java command

*************************************************************************************************************************************

**********     Wrong JVM version! You are running with .. but JIRA requires at least 1.8 to run.      **********

*************************************************************************************************************************************

 

I have followed this

https://jira.atlassian.com/browse/JRASERVER-21502

 

JAVA_HOME=/opt/atlassian/jira/jre

 

Still get the above error.

 

Checked java version

# /opt/atlassian/jira/jre/bin/java -version

java version "1.8.0_102"

Java(TM) SE Runtime Environment (build 1.8.0_102-b14)

Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)

 

I followed this

https://jira.atlassian.com/browse/JRASERVER-43770

 

[root@JIRA-Server bin]# cd /opt/atlassian/jira/bin

[root@JIRA-Server bin]# ./setenv.sh

                .....

          .... .NMMMD.  ...

        .8MMM.  $MMN,..~MMMO.

        .?MMM.         .MMM?.

 

     OMMMMZ.           .,NMMMN~

     .IMMMMMM. .NMMMN. .MMMMMN,

       ,MMMMMM$..3MD..ZMMMMMM.

        =NMMMMMM,. .,MMMMMMD.

         .MMMMMMMM8MMMMMMM,

           .ONMMMMMMMMMMZ.

             ,NMMMMMMM8.

            .:,.$MMMMMMM

          .IMMMM..NMMMMMD.

         .8MMMMM:  :NMMMMN.

         .MMMMMM.   .MMMMM~.

         .MMMMMN    .MMMMM?.

 

      Atlassian JIRA

      Version : 7.9.2

                  

 

If you encounter issues starting or stopping JIRA, please see the Troubleshooting guide at http://confluence.atlassian.com/display/JIRA/Installation+Troubleshooting+Guide

 

 

Server startup logs are located in /opt/atlassian/jira/logs/catalina.out

[root@JIRA-Server bin]# set

BASH=/bin/bash

BASHOPTS=checkwinsize:cmdhist:expand_aliases:extquote:force_fignore:histappend:hostcomplete:interactive_comments:login_shell:progcomp:promptvars:sourcepath

BASH_ALIASES=()

BASH_ARGC=()

BASH_ARGV=()

BASH_CMDS=()

BASH_LINENO=()

BASH_SOURCE=()

BASH_VERSINFO=([0]="4" [1]="2" [2]="46" [3]="2" [4]="release" [5]="x86_64-redhat-linux-gnu")

BASH_VERSION='4.2.46(2)-release'

COLUMNS=166

DIRSTACK=()

EUID=0

GROUPS=()

HISTCONTROL=ignoredups

HISTFILE=/root/.bash_history

HISTFILESIZE=1000

HISTSIZE=1000

HOME=/root

HOSTNAME=JIRA-Server

HOSTTYPE=x86_64

ID=0

IFS=$' \t\n'

JAVA_HOME=/opt/atlassian/jira/jre

LANG=en_GB.UTF-8

LESSOPEN='||/usr/bin/lesspipe.sh %s'

LINES=22

LOGNAME=root

LS_COLORS='rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.Z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.axv=38;5;13:*.anx=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.axa=38;5;45:*.oga=38;5;45:*.spx=38;5;45:*.xspf=38;5;45:'

MACHTYPE=x86_64-redhat-linux-gnu

MAIL=/var/spool/mail/root

MAILCHECK=60

OLDPWD=/opt/atlassian/jira/bin

OPTERR=1

OPTIND=1

OSTYPE=linux-gnu

PATH=/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.4/bin:/root/bin

PIPESTATUS=([0]="0")

PPID=2452

PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'

PS1='[\u@\h \W]\$ '

PS2='> '

PS4='+ '

PWD=/opt/atlassian/jira/bin

SHELL=/bin/bash

SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor

SHLVL=1

SUDO_COMMAND=/bin/bash

SUDO_GID=0

SUDO_UID=0

SUDO_USER=root

TERM=xterm-256color

UID=0

USER=root

USERNAME=root

_=./setenv.sh

colors=/root/.dircolors

[root@JIRA-Server bin]# ./config.sh

No JRE_HOME or JAVA_HOME environment variable is set - attempting to just run java command

*************************************************************************************************************************************

**********     Wrong JVM version! You are running with .. but JIRA requires at least 1.8 to run.      **********

*************************************************************************************************************************************

 

My understanding from what I read is setenv.h should set some variables including JAVA_HOME. Note: from the above capture JAVA_HOME is set, but that was due to me setting it manually above as outlined. If I reboot, JAVA_HOME is not present. If I then run setenv.sh again JAVA_HOME is still not present, which I thought setenv.sh should be doing?

Im new to the Linux world, and im struggling to understand what is happening here. 

Any help greatly appreciated.

 

3 answers

3 votes
James Griffin July 5, 2018

Update:

PATH=$PATH:/opt/atlassian/jira/jre/bin
[root@JIRA-Server bin]# ./config.sh

No JRE_HOME or JAVA_HOME environment variable is set - attempting to just run java command

Loading application properties from /opt/atlassian/jira/atlassian-jira/WEB-INF/classes/jira-application.properties

Reading database configuration from /var/atlassian/application-data/jira/dbconfig.xml

No graphics display available; using console.

----------------------

JIRA Configurator v1.1

----------------------

 

--- Main Menu ---

  [H] Configure JIRA Home

  [D] Database Selection

  [W] Web Server (incl. HTTP/HTTPs configuration)

  [A] Advanced Settings

  [S] Save and Exit

  [X] Exit without Saving

 

Main Menu> x

This got the config.sh script to run.

Im unsure why I had to do this though? I thought the installer should set all this up. Also im still unsure why setenv.sh does not appear to be setting variables as I described above. I have no JAVA_HOME or JRE_HOME environment variables by default, and am concerned this will give issues further down the line.

Any advice welcome.

1 vote
Brandon F. January 30, 2019

Just for anyone trying to perform the same on Ubuntu 18.04 you want to edit /etc/environment and add the /opt/atlassian/jire/jre/bin to the end, make sure to pre-pend with :

Oh and then apply the change (without rebooting)

source /etc/environment && export PATH
Brandon F. January 30, 2019

@James GriffinActually to solve the JAVA_PATH issue you can also add an additional line in your /etc/environment, the end result should be something like this:

 

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/atlassian/jira/jre/bin"
JAVA_HOME="/opt/atlassian/jira/jre/bin"

 Then apply it and see if echo $JAVA_HOME shows up:

source /etc/environment
echo $JAVA_HOME
/opt/atlassian/jira/jre/bin


1 vote
Abe December 17, 2018

Thank you James for posting the problem and solution! I was having the same issue - it doesn't make sense why the mapping wouldn't work right out the box...but at least there is a workaround!

 

Thanks!

Suggest an answer

Log in or Sign up to answer