fail to update jdk1.7.0_45 in raspberry pi

落爺英雄遲暮 提交于 2019-12-13 18:46:42

问题


I'm developing the TV Scoreboard app with the use of window laptop and raspberry pi. I'm using the putty to have socket connection.

Before that it request to state the X11 server variable, so I have installed the Xming server in my window laptop and fixed to localhost:0.0.0.0

But JFLauncher keep pop up the message to install the newest Java Runtime. So I think the latest and suitable one should be jre 1.7.0_45.

I have download the ejre-7u45-fcs-b15-linux-arm-vfp-hflt-client_headless-26_sep_2013

 mkdir java
    cd java
    tar zxvf *.gz

after unpack, I remove the rar file.

./bin/java -version

it show the latest version but if I just

java -version

it show the old version detail.

what should I do to update it to the latest version? Any mistake for my steps?


回答1:


but if i just java -version it show the old version detail.

When you run this command from your command line, the PATH environment variable is what the shell will evaluate to determine how to disambiguate your command. If you don't ensure that the new java binary location is in your PATH, and has a higher precedence than the old one, then the shell has no way of knowing to execute your new java.

Try the following:

$which java //tells you which java command the shell will execute
$echo $PATH //shows you what directories are in your path
$export PATH=/my/new/java/bin/directory:$PATH //set your new java into the PATH env
$java -version

See this tutorial on setting PATH.



来源:https://stackoverflow.com/questions/20780018/fail-to-update-jdk1-7-0-45-in-raspberry-pi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!