bash: export: “PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/: 不是有效的标识符
时间: 2023-09-20 09:11:25 浏览: 193
./nginx: No such file or directory
5星 · 资源好评率100%
这个错误是由于在设置环境变量时出现了一些问题导致的。具体来说,"bash: export: `=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/jdk1.8/bin:/usr/local/jdk1.8/jre/bin': not a valid identifier"的错误提示意味着在设置"="之后的变量时出现了不合法的标识符。同样地,"-bash: export: `=': not a valid identifier -bash: export: `/usr/local/jdk1.8/': not a valid identifier -bash: export: `=': not a valid identifier -bash: export: `/usr/local/jdk1.8/bin': not a valid identifier -bash: export: `=': not a valid identifier -bash: export: `/usr/local/jdk1.8/jre': not a valid identifier"的错误提示意味着在设置变量"/usr/local/jdk1.8/"和"/usr/local/jdk1.8/bin"时也出现了不合法的标识符。最后,"bash: export JAVA_HOME=/usr/local/java/jdk1.8.0_144: 没有那个文件或目录 -bash: export JAVA_BIN=/usr/local/java/jdk1.8.0_144/bin: 没有那个文件或目录 -bash: export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/bin: 没有那个文件或目录 -bash: export CLASSPATH=.:/lib/dt.jar:/lib/tools.jar: 没有那个文件或目录 bash: export JAVA_HOME JAVA_BIN PATH CLASSPATH: 未找到命令..."的错误提示意味着在执行"source /etc/profile"命令时找不到相关的文件或目录。
针对问题中提到的错误,首先需要检查环境变量的设置是否正确。确保每个环境变量都采用有效的标识符,并且路径是正确的。另外,还需要确认指定的文件或目录是否存在。你可以先使用"echo"命令来检查每个环境变量的值,如"echo $JAVA_HOME"、"echo $JAVA_BIN"等。如果没有显示任何输出或显示错误信息,那么可能是路径设置不正确或相关文件不存在。确保你设置的路径和文件名是正确的,并且相关文件确实存在。此外,你还可以检查文件和目录的权限,确保你有足够的权限来访问它们。如果问题仍然存在,请提供更多详细信息,以便更好地帮助你解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [安装jdk报错-bash: export: `=': not a valid identifier -bash: export: `/usr/local/jdk1.8/': not a ...](https://blog.csdn.net/laijunfeng816/article/details/79369099)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [linux安装jdk1.8出现错误bash: export JAVA_HOME=/usr/local/java/jdk1.8.0_144: 没有那个文件或目录](https://blog.csdn.net/shichen2010/article/details/77964188)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文