booting error message

Asked by Thushad T

when i am booting my ubuntu i got this error message >
error found when loading /etc/profile:
/etc/profile:line 28:JAVA_HOME:command not found
As a result the session will not be configured correctly.You should fix the problem as soon as feasible.

this is my sudo gedit /etc/profile file

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi
JAVA_HOME =/usr/lib/jvm/jdk-17
export JAVA_HOME

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

It's

export $JAVA_HOME

I think you need a leading dollar symbol.

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#2

No, I assume the error has a different cause.

There must not be a space between JAVA_HOME and the equal sign!

Change
JAVA_HOME =/usr/lib/jvm/jdk-17
into
JAVA_HOME=/usr/lib/jvm/jdk-17

Revision history for this message
Thushad T (thushadt) said :
#4

Thanks Manfred Hampl, that solved my question.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

ahhh, well I learned something too :)