Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (4k points)
edited by

I've installed JDK 7u7 downloaded from oracle's website. But after installation, the terminal is still showing java version 6

$java -version

java version "1.6.0_35"

Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)

Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)

any idea why java 7 is not showing up?

Ans: OK, the problem has been resolved. Here is the answer: I found that my Terminal has a .bash_profile and the java home variable is set to 1.6 

export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home"

So this is the line causing the problem every time I opened a new terminal window. Simply remove this line will solve the problem.  but if that doesn't work for you, check the .bash_profile (or .bashrc) setting file to see if you've previously exported any java version.

1 Answer

0 votes
by (46k points)

This is happening because you require to enter in Java Preferences pane and flag simply the JVM 7 in this form :

Java Preferences

To efficiently and immediately open the Java Preferences pane in Mac OS X you can directly call spotlight with ⌘+SPACE and type System Preferences it will dispense up in the end row of the window.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Jul 10, 2019 in Java by Krishna (2.6k points)
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...