我在 ubuntu 中將HADOOP作為單個節點使用,java home 設置為 java-8-openjdk-amd64/jre ?,F在我已經在bashrc我的 java home 中更改為指向 jdk-1.8.0(因為我需要它指向 jdk 而不是 jre 用于其他項目)。當我運行時出現hadoop fs -ls此錯誤:/usr/local/hadoop/bin/hadoop: line 166: /usr/lib/jvm/java-8-openjdk-amd64/jre//bin/java: No such file or directory有誰知道如何解決這個問題?這是我的 bashrc 文件: case $- in *i*) ;; *) return;; esac HISTCONTROL=ignoreboth shopt -s histappendHISTSIZE=1000HISTFILESIZE=2000 [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi case "$TERM" inxterm-color|*-256color) color_prompt=yes;; esacif [ -n "$force_color_prompt" ]; then if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then color_prompt=yes else color_prompt= fi fiif [ "$color_prompt" = yes ]; then PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ 'elsePS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ 'fiunset color_prompt force_color_promptcase "$TERM" inxterm*|rxvt*)PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1";;*);;esacif [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto'fialias ll='ls -alF'alias la='ls -A'alias l='ls -CF'alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
1 回答

溫溫醬
TA貢獻1752條經驗 獲得超4個贊
我解決了我的問題:
我們還必須更改etc/hadoop/hadoop-env.sh
Java_home:
# set to the root of your Java installation export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_181
添加回答
舉報
0/150
提交
取消