我正在尝试使用Ruby on Rails编写一个Web应用程序,并使用elasticsearch进行搜索。我知道弹性搜索在内部调用java api,事实上,它需要在机器上安装jdk。所以,我从官方的oracle网站上下载了java。文件'jdk-8u101-linux-x64.tar.gz'来自“http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html”。
下载完成后,我按照官方文档的建议从gz包中提取了文件,但我的机器上仍然没有安装java。我确信我错过了什么,但是什么?
Installation of the 64-bit JDK on Linux Platforms
This procedure installs the Java Development Kit (JDK) for 64-bit Linux, using an archive binary file (.tar.gz).
These instructions use the following file:
jdk-8uversion-linux-x64.tar.gz
Download the file.
Before the file can be downloaded, you must accept the license agreement. The archive binary can be installed by anyone (not only root users), in any location that you can write to. However, only the root user can install the JDK into the system location.
Change directory to the location where you would like the JDK to be installed, then move the .tar.gz archive binary to the current directory.
Unpack the tarball and install the JDK.
% tar zxvf jdk-8uversion-linux-x64.tar.gz
The Java Development Kit files are installed in a directory called jdk1.8.0_version in the current directory.
Delete the .tar.gz file if you want to save disk space.
答案 0 :(得分:1)
jdk1.8.0_version
/etc/profile
export JAVA_HOME="paste there the path that you copied"
export PATH=$JAVA_HOME/bin:$PATH
答案 1 :(得分:0)
您需要设置解压jdk-8uversion-linux-x64.tar.gz文件的路径