Make export JAVA_HOME=`/usr/libexec/java_home -v 1.8` permanent.

huangapple go评论42阅读模式
英文:

Make export JAVA_HOME=`/usr/libexec/java_home -v 1.8` permanent

问题

Sure, here's the translated code part:

每次我需要运行 JHipster 时,我都需要在终端中执行以下命令:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

我想要将其永久设置为这个文件夹。

我使用的是 macOS Catalina。

英文:

I making an App whit JHipster I have two java SDK 14 and 8

every time I need to run JHpster I have to do in the terminal

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`

i want to make it permanent for this folder

im on macOS Catalina

答案1

得分: 2

在Linux中,编辑文件“~/.bashrc”,在其中添加导出命令。

echo 'export JAVA_HOME=`/usr/libexec/java_home -v 1.8`' >> ~/.bashrc

然后,在一个新的Shell中,您应该能够看到导出的变量。如果您想在当前的GNOME/KDE会话中使用这个变量,您将需要注销/登录一次。

要么这样,要么您将需要创建一个脚本来启动您的应用程序/编译器。

英文:

In Linux, edit file "~/.bashrc", add the export command in that.

echo 'export JAVA_HOME=`/usr/libexec/java_home -v 1.8`' >> ~/.bashrc

Then, on a new shell, you should be able to see the variable exported. If you want to use the variable in your current GNOME/KDE session, you will need to logout/login again.

Either that or you will need to create a script to launch your application/compiler.

huangapple
  • 本文由 发表于 2020年7月31日 09:53:35
  • 转载请务必保留本文链接:https://go.coder-hub.com/63184704.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定