Error found when loading /etc/profile

Asked by Edmond Condillac

Hi

Kindly advise regarding the following error that appears when booting inti the Ubuntu partition on my dual boot notebook PC . The second OS is Windows 8.1 64-bit version.

The error reads:
Error found when loading /etc/profile
      /etc/profile line 34: export JAVA_HOME command not found
As a result the session will not be configured correctly
You should fix the problem as soon as feasible

Output of running uname -a:
edcon@HP-15:~$ uname -a
Linux HP-15 3.16.0-46-generic #62~14.04.1-Ubuntu SMP Tue Aug 11 16:27:16 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

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
Manfred Hampl (m-hampl) said :
#1

What is the output of

cat -n /etc/profile
dpkg -l | grep java

Revision history for this message
Edmond Condillac (econ22) said :
#2

The output of dpkg -S /etc/profile is:
dpkg-query: no path found matching pattern /etc/profile

Does this mean that the file /etc/profile is lost?

Revision history for this message
Edmond Condillac (econ22) said :
#3

The required output of cat -n /etc/profile is:

     1 # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
     2 # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
     3
     4 if [ "$PS1" ]; then
     5 if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
     6 # The file bash.bashrc already sets the default PS1.
     7 # PS1='\h:\w\$ '
     8 if [ -f /etc/bash.bashrc ]; then
     9 . /etc/bash.bashrc
    10 fi
    11 else
    12 if [ "`id -u`" -eq 0 ]; then
    13 PS1='# '
    14 else
    15 PS1='$ '
    16 fi
    17 fi
    18 fi
    19
    20 # The default umask is now handled by pam_umask.
    21 # See pam_umask(8) and /etc/login.defs.
    22
    23 if [ -d /etc/profile.d ]; then
    24 for i in /etc/profile.d/*.sh; do
    25 if [ -r $i ]; then
    26 . $i
    27 fi
    28 done
    29 unset i
    30 fi
    31
    32 JAVA_HOME=/usr/lib/jvm/java-8-oracle
    33 PATH=$PATH:$HOME/BIN:$JAVA_HOME/bin
    34 exportJAVA_HOME
    35 export PATH

Revision history for this message
Edmond Condillac (econ22) said :
#4

The output of dpkg -l | grep java is:

ii gir1.2-javascriptcoregtk-3.0 2.4.8-1ubuntu1~ubuntu14.04.1 amd64 JavaScript engine library from WebKitGTK+ - GObject introspection data
ii java-common 0.51 all Base of all Java packages
ii libjavascriptcoregtk-1.0-0:amd64 2.4.8-1ubuntu1~ubuntu14.04.1 amd64 JavaScript engine library from WebKitGTK+
ii libjavascriptcoregtk-3.0-0:amd64 2.4.8-1ubuntu1~ubuntu14.04.1 amd64 JavaScript engine library from WebKitGTK+
ii oracle-java8-installer 8u60+8u60arm-1~webupd8~1 all Oracle Java(TM) Development Kit (JDK) 8
ii oracle-java8-set-default 8u60+8u60arm-1~webupd8~1 all Set Oracle JDK 8 as default Java
edcon@HP-15:~$

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

There seems to be a typo error (missing space character) in the /etc/profile script.

Try

sudo gedit /etc/profile

scroll down to line 43 (last but one) and change

exportJAVA_HOME

into

export JAVA_HOME

save the file, close the editor, reboot, and report the result.

Revision history for this message
Edmond Condillac (econ22) said :
#6

Thanks for this.

Revision history for this message
Edmond Condillac (econ22) said :
#7

Thanks Manfred Hampl, that solved my question.