which java dir to add to path or set java_home?

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

which java dir to add to path or set java_home?

问题

我试图设置我的电脑以在Scala中进行编程,因此需要将Java添加到我的路径中。

现在,我已经下载了Java,并确保它是正确的版本1.8.0_261。

我可以找到一些教程,它们说我应该进入我的路径变量并将我的Java目录添加到其中,但我也可以找到一些说我应该创建一个java_home变量,并将其设置为我的Java。这两者哪一个是正确的?

此外,在教程中,人们通常有用于Java的目录是类似这样的:

C:\Program Files\Java\jdk1.7.0_60\bin
在我的情况下,我的Java似乎位于C:\Program Files (x86)\Common Files\Oracle\Java\javapath,为什么我的文件夹不叫jdk?我是不是做错了什么?

英文:

im attempting to set up my pc for programming in scala, therefore I need to add java to my path.

Now, I have downloaded Java, and ensured that it is te correct version 1.8.0_261.

I can find tutorials that say that I should go in my path variable and add my java dir to there, but I can also find ones that say that I should make a java_home variable, and set it to my java. Which one of these is true?

Also in tutorials, the directory that people usually have for java is something like:

 C:\Program Files\Java\jdk1.7.0_60\bin

In my case, my java seems to be in C:\Program Files (x86)\Common Files\Oracle\Java\javapath, why is my folder not called jdk? am i doing something wrong?

答案1

得分: 0

这是Oracle设置的方式,天知道为什么。使用C:\Program Files\Java\jdk1.8.0_261\bin,你可以继续从PATH中删除javapath,它仍然可以正常工作。你没有做错任何事情。

英文:

That is how Oracle set it up, god knows why. Use C:\Program Files\Java\jdk1.8.0_261\bin, you can go ahead and remove the javapath from your PATH and it will still work. You have done nothing wrong.

huangapple
  • 本文由 发表于 2020年7月22日 05:13:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/63023197.html
匿名

发表评论

匿名网友

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

确定