I am getting my new laptop going and went to install the latest oracle JDK 7u25. I followed the instructions on this site to do it.

Afterwards when I type java --version in the terminal I get the error:

Error: Could not create the Java Virtual Machine

I tried reinstalling it via a different method but the error wont go away. I am running Ubuntu 12.04 64bit.


I would advise you to use the webupd8 method instead since that way you just need to add a PPA and then you can just install jdk through apt and get updates.

  • im sorry but this didnt fix the problem – John Jul 26 '13 at 13:36
  • Did you first remove your first installation ? – Benoît Legat Jul 26 '13 at 20:14
  • yes, at this point I reinstalled Ubuntu, i was working on a fresh install anyway. – John Jul 26 '13 at 20:26
  • Well then if the PPA doesn't work I would advise you do contact webupd8 directly telling him the problem so that he can fix it for you and for him – Benoît Legat Jul 28 '13 at 12:00
  • Oh, you mean you did a fresh install and now it is working ? – Benoît Legat Jul 28 '13 at 12:07


java -version

instead of:

java --version

However, it's still not excusable that such cryptic error message is produced for the extra dash sign. Especially because java is not an amateur software but a kind of the very best software.

  • @Umair Thus, the upvote... – Nabil Kadimi May 31 '16 at 8:55
  • 1
    Wonder how many pro devs have been brought to their knees by this one. Thanks!! – Casey Murray Aug 16 '16 at 19:53
  • @Dmitriy Sintsov: Just goes a long way towards telling that it is far from the very best software. Just because it is popular, doesn't mean it's good - otherwise JavaScript would be the most awesome language in the world - it isn't ... – WitchCraft Jan 18 '17 at 14:28
  • I literally just got the same "cryptic" error when just using java -v – Jay Stevens Apr 18 '18 at 19:01
  • 1
    You're the man. Thanks – Emad Jun 17 '19 at 8:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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