java - 最近转用mac开发了,安装jre顺利装好,但是跑tomcat时老是提示没有安装运行环境
天蓬老师
天蓬老师 2017-04-18 09:14:16
0
5
373

而且mac Library下的javaVertualMachies文件夹里也是空的,求mac大神指导

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(5)
巴扎黑

Java etc. are placed in the /usr/bin/ 目录下的都是 wrapper,实际上是看 /usr/libexec/java_home 命令所指向的 JAVA_HOME,所以只需要解压 jdk 到 /Library/Java/JavaVirtualMachines directory, and it will be automatically recognized and used. There is no need to configure PATH and JAVA_HOME environment variables.


Oracle JDK for Mac actually installs three parts. One part is the Java command Wrapper that is now installed by default on Apple systems, the second part is the JDK itself, and the third part is the Applet and Java updater, so the pkg provided by Oracle JDK can be decompressed. , and then copy the JDK ontology to the /Library/Java/JavaVirtualMachines directory, which makes it easier to change versions.

大家讲道理

at terminal执行java命令试试,看看加入环境变量了没.
备注:mac 环境和 Linux是一样的,你可以下载一个jdk解压,然后把jdk目录加入环境变量PATH里面,就可以了.
配置环境变量可以在home目录下的.bashrc文件中加入export PATH=$PATH:jdkhome

PHPzhong

Need to installjdkah...

左手右手慢动作

First open the terminal in the utility and see if the PATH of jre has been added.

大家讲道理

Configure jdk
/etc/profile
This can be used for operating systems under the unix system tree.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template