Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
Can you paste the error to your question? – i08in Feb 15 '14 at 8: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 8:37
Please post the exact error message, as it is. It is difficult to make out from just a part of the error message. – i08in Feb 15 '14 at 9: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: – i08in Feb 15 '14 at 9: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. – minerz029 Feb 15 '14 at 9:55
  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?.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.