简体   繁体   English

Vagrant java 1.6到1.8

[英]Vagrant java 1.6 to 1.8

I Installed vagrant on my machine with hashicorp-precise32 virtual machine. 我使用hashicorp-precise32虚拟机在我的机器上安装了vagrant It installed java 1.6 whereas i want java 1.8 . 它安装了java 1.6,而我想要java 1.8 Do i have to install another virtual machine? 我必须安装另一个虚拟机吗? How to get java 1.8? 如何获得java 1.8?

Add below lines in your Vagrantfile , It will install Java 8 (accepting licenses) and also set the Environmental variables in your guest VM: Vagrantfile中添加以下行,它将安装Java 8 (accepting licenses)并在guest虚拟机VM中设置环境变量:

sudo apt-get install -y software-properties-common python-software-properties
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java8-installer
echo "Setting environment variables for Java 8.."
sudo apt-get install -y oracle-java8-set-default

Moreover, you can refer Creating and Provisioning VM using Vagrant 此外,您可以参考使用Vagrant创建和配置VM

It depends on the os you put on the virtualbox, the one you installed has ubuntu so you will want to follow instructions from here 这取决于您放在虚拟机上的操作系统,您安装的操作系统具有ubuntu,因此您需要按照此处的说明操作

$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer
$ sudo apt-get install oracle-java8-set-default

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM