0

I installed 12.04. Yesterday I tried installing tomcat server and java. There was some errors in that installation and when I tried to open my system after some time I couldn't login. At that time I found its in loop. When I used terminal using ctrl+alt+f1. I can login there, and after login there shows one error which I incurred while installing java.

it shows like in 31 line.

Syntax error near unexpected token '('

and also in line

export JAVA_HOME=/media/F25ACC3E5ACBFCFB/Program Files (x86)/Java
Braiam
  • 67,791
  • 32
  • 179
  • 269
jithin
  • 11
  • 2
  • Can you paste the error to your question? – jobin Feb 15 '14 at 08:27
  • it shows like in 31 line..syntax error near unexpected token '(' and also in line 'export JAVA_HOME=/media/F25ACC3E5ACBFCFB/Program Files (x86)/Java' – jithin Feb 15 '14 at 08:37
  • 1
    Please post the exact error message, as it is. It is difficult to make out from just a part of the error message. – jobin Feb 15 '14 at 09:03
  • It seems like you are trying to link the path to Java binaries you have installed on windows to ubuntu. This won't work. You need to install Java on ubuntu and export the path as JAVA_HOME. Refer this to see how to install java: http://askubuntu.com/questions/48468/how-do-i-install-java – jobin Feb 15 '14 at 09:27
  • @AvinashRaj: Wont work in this case. In this case, the problem is with a file the OP edited himself, not a Xauthority file or similar. – kiri Feb 15 '14 at 09:55
  • @jobin and @ avinash raj..grateful to ur comments. when i login via ctrl+alt+f1..my error report is like this -bash: /etc/profile: line 31:syntax error near unexpected token '(' and second error -bash: /etc/profile:line 31:'export JAVA_HOME=/media/F25ACC3E5ACBFCFB/Program Files (x86)/Java' – jithin Feb 15 '14 at 16:58
  • only i need to solve this problem and delete those installed java and again get back to old state..all i have done coz f my foolishness..please hit me with a solution to get back to working stage.thanx – jithin Feb 15 '14 at 17:21
  • @AvinashRaj this is not a duplicated – Braiam Mar 14 '14 at 23:36

2 Answers2

1
  1. Login via Ctrl+Alt+F1.
  2. Run this command:

    nano "$(grep -l 'export JAVA_HOME=/media/F25ACC3E5ACBFCFB/Program Files (x86)/Java' ~/* 2>/dev/null | head -n1 | tr -d '\n')"
    
  3. Delete this line (should be at or near line 31):

    export JAVA_HOME=/media/F25ACC3E5ACBFCFB/Program Files (x86)/Java
    
  4. Save and exit with Ctrl+X, Y, Enter.

  5. Login should now work.

For how to install Java correctly, see How do I install Java?.

kiri
  • 28,246
  • 16
  • 81
  • 118
-1

Try ctrl+alt+F1 To open terminal and run this command:

rm- rf .gnome .gnome2 .gncof .gconfd .metacity

This will reset some gnome settings and login should work. Let me know if it works.

Thermo
  • 1