0

I'm currently running Ubuntu GNOME 16.10 on my pc, and unfortunately, I don't have an internet connection. I really really need to be able to run java programs on it, because I've started learning java. My phone has an internet connection. Is there any way that I can download java onto my phone and then install it on my pc manually without an internet connection?

Caramello
  • 280
  • 1
  • 7
  • 23

3 Answers3

2

Download the java SE from ORACLE site (zip or tgz), find a way to put your packed file on the Ubuntu box then unpackit.

Let say you do unpack at /opt/jdk_xyz

add then on your .bashrc file in your home directory the folowwing

export JAVA_HOME=/opt/jdk_xyz export PATH=$PATH:$JAVA_HOME/bin

Pascal Fares
  • 749
  • 5
  • 8
  • Thank you so much for the answer. But, I found an easier way. I connected my phone to my pc via USB, and turned on USB tethering. That way, I was able to use my phone's internet on my pc, and I downloaded and installed the jdk. Either way, thank you so much for your time and the answer :) – Caramello Jul 02 '17 at 09:43
0

What type of phone is it? You should be able to set up a hot spot on your phone and connect it to your computer.

0

VIA DPKG (Recommended)

To install Java JDK:


VIA TAR.GZ

From TecMint:

  • Download Java SE Development Kit using the command:

    mkdir -p /opt/java && cd /opt/java && wget --header='Host: download.oracle.com' --header='User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0' --header='Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' --header='Accept-Language: en-US,en;q=0.5' --header='Referer: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html' --header='Cookie: s_cc=true; s_nr=1498980917874; gpw_e24=http%3A%2F%2Fwww.oracle.com%2Ftechnetwork%2Fjava%2Fjavase%2Fdownloads%2Fjdk8-downloads-2133151.html; s_sq=%5B%5BB%5D%5D; mmapi.store.p.0=%7B%22mmparams.d%22%3A%7B%7D%2C%22mmparams.p%22%3A%7B%22pd%22%3A%221530516890611%7C%5C%22-1391031818%7CAgAAAApVAgBicrOD%2Bw4AARAAAUL58MllAQBg%2BanSHMHUSMBunc0cwdRIAAAAAP%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FAAZEaXJlY3QB%2Bw4BAAAAAAAAAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FAAAAAAAAAAFF%5C%22%22%2C%22srv%22%3A%221530516890619%7C%5C%22lvsvwcgus07%5C%22%22%7D%7D; mmapi.store.s.0=%7B%22mmparams.d%22%3A%7B%7D%2C%22mmparams.p%22%3A%7B%7D%7D; oraclelicense=accept-securebackup-cookie' --header='Connection: keep-alive' --header='Upgrade-Insecure-Requests: 1' 'http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz?AuthParam=1498981040_490f55b758f4176934eced4b212765c4' -O 'jdk-8u131-linux-x64.tar.gz' -c
    
  • Extract the file:

    tar -xvzf jdk-8u131-linux-x64.tar.gz
    
  • Change directory:

    cd jdk1.8.0_131/
    
  • Update alternatives:

    sudo update-alternatives --install /usr/bin/java java /opt/java/jdk1.8.0_45/bin/java 100 && sudo update-alternatives --config java && sudo update-alternatives --install /usr/bin/javac javac /opt/java/jdk1.8.0_45/bin/javac 100 && update-alternatives --config javac && sudo update-alternatives --install /usr/bin/jar jar /opt/java/jdk1.8.0_45/bin/jar 100 && sudo update-alternatives --config jar
    
  • Setup environment variables:

    sudo export JAVA_HOME=/opt/java/jdk1.8.0_131/ && sudo export JRE_HOME=/opt/java/jdk1.8.0_131/jre && sudo export PATH=$PATH:/opt/java/jdk1.8.0_131/bin:/opt/java/jdk1.8.0_131/jre/bin 
    
    • Or a better way to setup environment variable globally:
      • Edit /etc/environment and add these lines:
        • JAVA_HOME=/opt/java/jdk1.8.0_131/
        • JRE_HOME=/opt/java/jdk1.8.0_131/jre
        • PATH=$PATH:/opt/java/jdk1.8.0_131/bin:/opt/java/jdk1.8.0_131/jre/bin
      • Reboot the system.
Raphael
  • 8,035