更改cmake安装,但仍找到以前的版本

时间:2018-07-09 19:05:09

标签: unix cmake

我当前正在尝试删除public class SliderListener implements ChangeListener { private int sliderIndex = 0; private IconScaleManager iconScaleManager = null; public SliderListener(int startingIndex, IconScaleManager renderer) { sliderIndex = startingIndex; iconScaleManager = renderer; } @Override public void stateChanged(ChangeEvent e) { JSlider source = (JSlider)e.getSource(); sliderIndex = source.getValue(); iconScaleManager.scaleSlider(sliderIndex); } } ,并将默认cmake指向我自己安装的版本,该版本比之前的版本要高:

我删除了/usr/bin/cmake,并且从/usr/bin/cmake中删除,它似乎指向which cmake中的正确路径。但是,它在这里不起作用

/opt/cmake

从绝对路径运行它会起作用:

root@i-0555fc08518f7d737:~/temp# readlink /usr/local/bin/cmake
/opt/cmake/bin/cmake
root@i-0555fc08518f7d737:~/temp# source ~/.bashrc
root@i-0555fc08518f7d737:~/temp# which cmake
/usr/local/bin/cmake
root@i-0555fc08518f7d737:~/temp# cmake --version
bash: /usr/bin/cmake: No such file or directory

这:

root@i-0555fc08518f7d737:/opt/cmake/bin# /opt/cmake/bin/cmake --version
cmake version 3.11.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

但不是这样:

root@i-0555fc08518f7d737:/opt/cmake/bin# $(which cmake) --version
cmake version 3.11.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

这是怎么回事?

0 个答案:

没有答案