Issue
I need to change my java version under jupyter notebook. After several tries I found out that I am unable to change PATH variable via following code snippet.
!export JUPYTER_PATH=%JAVA_HOME%/bin:%PATH%:%HOME%/.local/bin:%HOME%/bin
!echo $PATH
/data/anaconda3/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
Also the notebook not retrieving my local .bash_profile even though I use the code below.
!source /home/username/.bash_profile
Is there a way to change Java version of the notebook?
Solution
I have found the solution as follows.
import os
os.environ['JAVA_HOME'] = '/usr/lib/jvm'
os.environ['PATH'] = '/usr/lib/jvm/jre/bin:' + os.environ['PATH']
print(os.environ['PATH'])
Answered By - Jungleman
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.