0

i want to change my java version from 6 to 8. But in terminal it always active as java 6 i have run this command : export JAVA_HOME=/usr/libexec/java_home -v 1.8.0_271

but it always show as java 1.6.0 after i run those command any suggestion or other way that i need to do or check first ?

i delete jdk folder 1.6.0 when i run java -version the result is jenv: version 1.6.0.65' is not installed jenv: version 1.6.0.65' is not installed am i missing something ?

thank you

Diana
  • 33
  • 6
  • If you look at the accepted answer, you'll see that you forgot the two `\`` characters, i.e. it should be `export JAVA_HOME=\`/usr/libexec/java_home -v 1.8.0_271\`` – Andreas Dec 04 '20 at 14:31
  • i have been try add ` but it still not working. i delete the jdk version of 1.6.0 but when i run java -version it shw java 1.6.0 not installed. am i missing some setting ? – Diana Dec 04 '20 at 14:34
  • Did you do what it says? *"First run `/usr/libexec/java_home -V`"*? What did that command print? – Andreas Dec 04 '20 at 14:35
  • the result is : Matching Java Virtual Machines (1): 1.8.0_271, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home – Diana Dec 04 '20 at 14:38
  • **Edit** the question and show it there. – Andreas Dec 04 '20 at 14:39

0 Answers0