如何设置[Windows上的Ubuntu上的Bash] [环境变量]来自[Windows路径]?
尝试使用samza.apache.org/startup/hello-samza/0.7.0/与猛砸在Windows如何设置[Windows上的Ubuntu上的Bash] [环境变量]来自[Windows路径]?
它将运行
bin/grid bootstrap
其中流动代码
if [ -z "$JAVA_HOME" ]; then
if [ -x /usr/libexec/java_home ]; then
export JAVA_HOME="$(/usr/libexec/java_home)"
else
echo "JAVA_HOME not set. Exiting."
exit 1
fi
fi
给出错误
JAVA_HOME not set. Exiting.
在CMD当我运行
echo %JAVA_HOME%
我得到
C:\Program Files (x86)\Java\jdk1.8.0_102\
我要导入的路径数据来砸
我会尝试export JAVA_HOME="/mnt/c/Program Files (x86)/Java/jdk1.8.0_102"
设置JAVA_HOME变量bash shell中。
更新(回答您的编辑):
我不会建议试图自动导入你的Windows路径来砸在Ubuntu上的Windows,因为路径必须被转换成由bash的理解外壳(\
到/
,C:\
到mnt/c/
等),因为不是所有的你可能要去参考在Windows和Linux将工作的工具。取而代之的是,安装你所需要的Bash shell中使用什么apt-get
(你不需要使用sudo
因为BUW负载在一个root shell)。如上所述,Java可能很适合引用,但大多数情况下,您需要在Ubuntu上单独安装。
工作!但现在它要求git路径?我的主要问题:是否有办法在庆典启动时自动设置的bash从窗口路径Path变量 –
您可能需要在bash shell中安装git的,如果你还没有准备好。 ('apt-get update',然后'apt-get git')将变量添加到你的'〜/ .bashrc'文件中(语法相同) - 。然后,重新启动shell,或者键入'source〜/ .bashrc'来重新加载环境变量。 –
apt-get会安装新的instanse,我有 “到/ mnt/C //程序文件/混帐/ CMD/git.exe” 和 “C:\用户\穆罕默德\ .bashrc中” 像这样的https://要点。 github.com/Elrashid/a16f74449c108d2336aec21abe80fa59如何添加它? –
你有没有在Bash shell中安装的Java直接?它不会识别路径'C:\ ...'。在Windows上的Ubuntu Bash上,路径将是'/ mnt/c/...'在bash shell中运行'echo $ JAVA_HOME'时会发生什么? –
如何直接在Bash shell上安装Java?回声$ JAVA_HOME给出了一个空行 –
如果要安装JDK的Ubuntu - https://stackoverflow.com/questions/36478741/installing-oracle-jdk-on-windows-subsystem-for-linux –