Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.24 KB | None | 0 0
  1. This is based entirely off of @BhargavRao's [answer](https://stackoverflow.com/c/sobotics/a/152/23), but meant to be a complete walk-through to those who want to set it up but are not techies.
  2.  
  3. This is going to explain how to run a Natty instance, starting completely from scratch on a Ubuntu live boot. It should work for an installed version as well.
  4.  
  5. You can **follow the instructions to [run a live boot](https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-windows#0)** from a USB stick/CD/what have you. This will take several hours to set up the live boot completely if you're a non-techie like me, in all likelihood, so make sure you have free time.
  6.  
  7. After you've got the live boot up and running (which is no small task. At all), and made sure to connect it to the Internet, press the <kbd>super</kbd> key (AKA the Windows key if you're on a Windows computer), and type `terminal`. Then press <kbd>enter</kbd> to open it.
  8.  
  9. You should see something like this:
  10.  
  11. ubuntu@ubuntu:~$
  12.  
  13. Congrats! You've gotten past the first stage, and you can now start to set things up.
  14.  
  15. Since a live boot (running from the USB) has nothing on it yet, we're going to need to install pretty much everything.
  16.  
  17. **Installing Java**
  18.  
  19. For non-live-boot-running people, you can check if Java is installed by running this command:
  20.  
  21. java -version
  22.  
  23. That should look like this when you run it:
  24.  
  25. ubuntu@ubuntu:~$ java -version
  26.  
  27. The first "ubuntu" is the name of your user account, and the second is the name of the computer. So that could also be `mithrandir@barad-dur:~$ java -version`. The `ubuntu@ubuntu:~$` is what shows on a live boot.
  28.  
  29. If it's installed, you'll should get something like this:
  30.  
  31. openjdk version "1.8.0_151"
  32. OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
  33. OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)
  34.  
  35. The specifics will change depending on what version of Ubuntu it has, and whether it's 32-bit or 64-bit. My non-live-boot is running 64-bit Ubuntu 16.04, as you can see above.
  36.  
  37. If it's not installed, you'll get something like this:
  38.  
  39. The program 'java' can be found in the following packages:
  40. * default-jre
  41. * openjdk-8-jre-headless
  42. * gcj-4.8-jre-headless (You will have to enable component called 'universe')
  43. * gcj-4.9-jre-headless (You will have to enable component called 'universe')
  44. * gcj-5-jre-headless (You will have to enable component called 'universe')
  45. * gcj-6-jre-headless (You will have to enable component called 'universe')
  46. * openjdk-9-jre-headless (You will have to enable component called 'universe')
  47. Try: sudo apt install <selected package>
  48.  
  49. We'll want to install either `openjdk-9-jre-headless` or `openjdk-8-jre-headless`. I've installed 8 in the following instructions.
  50.  
  51. The terminal has just told us what to do to install it, so let's follow those instructions:
  52.  
  53. sudo apt-install openjdk-8-jre-headless
  54.  
  55. If you're running on a non-live-boot, you'll be prompted to put in the password, like this:
  56.  
  57. [sudo] password for mithrandir:
  58.  
  59. You type in your password and hit <kbd>enter</kbd>.
  60.  
  61. If you're running it on the live boot, it should tell you packages will be installed. It will then ask you if you want to continue, with a message like this:
  62.  
  63. After this operation, 99.9 MB of additional disk space will be used.
  64. Do you want to continue? [Y/n]
  65.  
  66. Since we do want to continue, we'll type `y` and hit <kbd>enter</kbd>. That line should look like `Do you want to continue? [Y/n] y` after this.
  67.  
  68. If all goes well, your screen will fill with gibberish and scroll down a lot. (A lot of `adding debian` lines should show up.)
  69.  
  70. If you get an error "could not resolve 'archive.ubuntu.com'", then make sure you have an Internet connection. Make sure you're connected to WiFi (or Ethernet). Once your Internet is set up, run `sudo apt-install openjdk-8-jre-headless` again. If that still doesn't work, then check [this Ask Ubuntu post](https://askubuntu.com/q/29071/511730).
  71.  
  72. When the gibberish is done scrolling past, your terminal should show
  73.  
  74. done.
  75. done.
  76.  
  77. at the end, and have `ubuntu@ubuntu:~$` waiting for a new command.
  78.  
  79. To make sure it's installed, run
  80.  
  81. java -version
  82.  
  83. and it should show
  84.  
  85. openjdk version "1.8.0_151"
  86.  
  87. and a couple other lines.
  88.  
  89. Good job, Java is installed!
  90.  
  91. **Installing Maven**
  92.  
  93. If you're not running on a live boot, you can check if maven is installed by running this command:
  94.  
  95. mvn -v
  96.  
  97. If it's installed, it'll show something like this:
  98.  
  99. Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T18:41:47+02:00)
  100. Maven home: /opt/maven
  101. Java version: 1.8.0_151, vendor: Oracle Corporation
  102. Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
  103. Default locale: en_US, platform encoding: UTF-8
  104. OS name: "linux", version: "4.4.0-109-generic", arch: "amd64", family: "unix"
  105.  
  106. If it's not installed, such on the live boot, you'll see something like this:
  107.  
  108. The program 'mvn' is currently not installed. You can install it by typing:
  109. sudo apt install maven
  110. You will have to enable the component called 'universe'
  111.  
  112. So, let's install it.
  113.  
  114. To prevent errors, let's install those things that are needed so that we can install maven. Hat-tip to [this Ask Ubuntu answer](https://askubuntu.com/a/722994/511730).
  115.  
  116. All of these commands will make text appear after you press enter. Unless there are errors, you shouldn't be worried.
  117.  
  118. First, we run this command:
  119.  
  120. sudo apt-get install software-properties-common
  121.  
  122. (for more info on that, see [What is software-properties-common](https://askubuntu.com/q/1000118/511730) on Ask Ubuntu)
  123.  
  124. Then we can install the universe:
  125.  
  126. sudo add-apt-repository universe
  127.  
  128. Then update:
  129.  
  130. sudo apt-get update
  131.  
  132. And then finally we can install maven:
  133.  
  134. sudo apt-get install maven
  135.  
  136. To check if it installed properly, you can run `mvn --version`. That should show this:
  137.  
  138. Apache Maven 3.5.0
  139. Maven home: /usr/share/maven
  140. Java version: 1.8.0_151, vendor: Oracle Corporation
  141. Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
  142. Default locale: en_US, platform encoding: UTF-8
  143. OS name: "linux", version: "4.13.0-16-generic", arch: "amd64", family: "unix"
  144.  
  145. Good! Maven is installed.
  146.  
  147. **Installing Tomcat**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement