0

I am having some issues while trying to install java : "sudo apt install default-jre" on a VM instance : enter image description here

I realized that my VM has no external ip address as my company wont allow it. I can ping the localhost on the VM but not www.google.com fro example so i figured the lack of external IP was the issue. Is there another way that i can install java on this VM? I just have a basic java code (not an app) that i want to try by running "java -jar myjarname.jar".

Any idea would be helpfull.

GcpTrainee
  • 67
  • 4

2 Answers2

3

If your goal is to be able to download from the Internet, set up a NAT Gateway.

Cloud NAT overview

Another option is to set up a VPN to your corporate network which provides a route to the Internet.

Otherwise, you will need to upload files to your VM and install them manually.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
0

Why not upload the *.deb package and then install it?

https://cloud.google.com/shell/docs/uploading-and-downloading-files

Martin Zeitler
  • 1
  • 19
  • 155
  • 216