Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I installed the Oracle jdk1.7.0_25 and the Jre1.7.0_25 on Ubuntu 12.10. I used the install method at http://www.noobslab.com/2012/12/install-oracle-java-7-in-ubuntu.html. When I execute "java -version", without the quotes, I get the following: /usr/bin/java: 1: /usr/bin/java: Syntax error: end of file unexpected(expected ")") Does anyone know what is going on here?

share|improve this question

marked as duplicate by Thomas W., Jorge Castro, Seth, aquaherd, Kevin Bowen Jun 22 '13 at 0:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

This is improper installation. Install through Ubuntu Software Center: Go for Open JDK Java6Runtime and Iced Tea plugin for browsers, better way of installation.

aman@ubuntu:~$ java -version
java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-1ubuntu1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
share|improve this answer

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