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

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 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 Ward, Jorge Castro, Seth, aquaherd, Kevin Bowen Jun 22 '13 at 0:02

This question was marked as an exact duplicate of an existing question.

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.