forked from cs1331/cs1331.github.io.old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-java.html
executable file
·145 lines (143 loc) · 8.1 KB
/
install-java.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
---
layout: default
title: CS 1331 - Installing Java
---
<h1 class="title">Installing The JDK</h1>
<h2 class="subtitle" id="originally-by-ashutosh-gupta">Originally by Ashutosh Gupta</h2>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#windows">Windows 7+</a></li>
<li><a class="reference internal" href="#mac-os-x">Mac OS X</a></li>
<li><a class="reference internal" href="#linux">Linux</a></li>
<li><a class="reference internal" href="#troubleshooting">Troubleshooting</a></li>
</ul>
</div>
<div class="section" id="windows">
<h1>Windows 7+</h1>
<ol class="arabic">
<li><p class="first">Download and run the appropriate Java Development Kit installer from <a class="reference external" href="http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html#javasejdk">http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html#javasejdk</a></p>
<ul>
<li><p class="first">To determine if your machine is running 32- or 64-bit,</p>
<ul>
<li><p class="first">Windows 7</p>
<ul>
<li><p class="first">Go to Start</p>
</li>
<li><p class="first">Right-click on "Computer"</p>
</li>
<li><p class="first">Choose "Properties"</p>
</li>
</ul>
</li>
</ul>
<ul>
<li><p class="first">Windows 8</p>
<ul>
<li><p class="first">Open Start by clicking on the Windows Logo</p>
</li>
<li><p class="first">Search for "System" and click on the System option</p>
</li>
</ul>
</li>
</ul>
<blockquote>
<p>Under System Type, you should see either "32-bit Operating System" or "64-bit Operating System".</p>
</blockquote>
</li>
</ul>
</li>
</ol>
<img alt="win32-64.jpg" class="align-center" src="images/win32-64.jpg" style="width: 480px;"/>
<ol class="arabic" start="2">
<li><p class="first">Update your system PATH variable:</p>
<ul>
<li>Windows 7
<ul class="simple">
<li>Go to Start</li>
<li>Choose "Control Panel"</li>
<li>In the search bar at the top right, type "Path" and press enter</li>
<li>Choose "Edit the system environment variables"</li>
<li>Click "Environment Variables" at the bottom of the window</li>
<li>In the "System variables" section, scroll to "Path"</li>
<li>Select the Path variable and click "Edit", or click New and add a Path variable if one doesn't exist</li>
<li>Under "Variable value", add <tt class="docutils literal"><span class="pre">;C:\Program</span> Files\Java\jdk1.8.0_60\bin</tt> to the end of what's already there</li>
</ul>
</li>
</ul>
<ul>
<li>Windows 8
<ul class="simple">
<li>Open Start by clicking on the Windows Logo</li>
<li>Search for "environment" and choose "Edit the system environment variables"</li>
<li>Click "Environment Variables" at the bottom of the window</li>
<li>In the "System variables" section, scroll to "Path"</li>
<li>Select the Path variable and click "Edit", or click New and add a Path variable if one doesn't exist</li>
<li>Under "Variable value", add <tt class="docutils literal"><span class="pre">;C:\Program</span> Files\Java\jdk1.8.0_60\bin</tt> to the end of what's already there</li>
</ul>
</li>
</ul>
<p>The system Path variable tells the operating system where to find the Java tools that you installed in step 1. If you did not install the tools in <tt class="docutils literal"><span class="pre">C:\Program</span> Files\Java\jdk1.8.0_60</tt>, change that portion of the path to the correct folder. Important: the path must have bin at the end.</p>
<p>It is important that there is a semicolon (;) separating the folder that you add from the previous folder. For example, if your Path variable looks like this initially:</p>
<pre class="code literal-block">
C:\Foo\bin;C:\Bar\bin
</pre>
<p>it should look like this after you add the new folder:</p>
<pre class="code literal-block">
C:\Foo\bin;C:\Bar\bin;C:\Program Files\Java\jdk1.8.0_60\bin
</pre>
<p>Press "OK" in all prompts until all the windows we opened are closed.</p>
</li>
<li><p class="first">Determine if Java was installed correctly at the command line (the Windows <tt class="docutils literal">cmd.exe</tt> program):</p>
<ul class="simple">
<li>Press the Windows Key + R</li>
<li>Type "cmd"</li>
<li>Press enter</li>
<li>At the command prompt type <tt class="docutils literal">javac <span class="pre">-version</span></tt>. You should get output on the next line like <tt class="docutils literal">javac 1.8.0_60</tt>.</li>
<li>At the command prompt type <tt class="docutils literal">java <span class="pre">-version</span></tt>. You should get output that contains <tt class="docutils literal">java version "1.8.0_60</tt>.</li>
</ul>
</li>
</ol>
</div>
<div class="section" id="mac-os-x">
<h1>Mac OS X</h1>
<ol class="arabic simple">
<li>Download and run the appropriate Java Development Kit installer DMG from <a class="reference external" href="http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html#javasejdk">http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html#javasejdk</a></li>
<li>Double-click on the <tt class="docutils literal">.dmg</tt> file you downloaded to mount it and open it in the Finder.</li>
<li>Double click on the installer <tt class="docutils literal">.pkg</tt> file to run the installer.</li>
<li>Check that the JDK has been properly installed.<ul>
<li>Run <tt class="docutils literal">/Applications/Utilities/Terminal.app</tt></li>
<li>At the command prompt type <tt class="docutils literal">java <span class="pre">-version</span></tt>. You should get output on the next line like <tt class="docutils literal">java version "1.8.0_60</tt>.</li>
<li>At the command prompt type <tt class="docutils literal">javac <span class="pre">-version</span></tt>. You should get output like <tt class="docutils literal">javac 1.8.0_60</tt>.</li>
</ul>
</li>
</ol>
</div>
<div class="section" id="linux">
<h1>Linux</h1>
<ol class="arabic simple">
<li>Download and run the appropriate Java Development Kit installer from <a class="reference external" href="http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html#javasejdk">http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html#javasejdk</a></li>
</ol>
<p>OR</p>
<blockquote>
For Ubuntu and other debian based distribution, install openjdk using your default package manager</blockquote>
<p>OR</p>
<blockquote>
For Fedora-based and other distros that use the Redhat Package Manager format, download the correct "Linux RPM" architecture from Java Downloads</blockquote>
<ol class="arabic simple" start="2">
<li>Add the JDK's <tt class="docutils literal">bin</tt> directory to your <tt class="docutils literal">PATH</tt> environment variable, if necessary.</li>
<li>Check that the JDK has been properly installed.<ul>
<li>Open a terminal window.</li>
<li>At the command prompt type <tt class="docutils literal">java <span class="pre">-version</span></tt>. You should get output on the next line like <tt class="docutils literal">java version "1.8.0_60</tt>.</li>
<li>At the command prompt type <tt class="docutils literal">javac <span class="pre">-version</span></tt>. You should get output like <tt class="docutils literal">javac 1.8.0_60</tt>.</li>
</ul>
</li>
</ol>
</div>
<div class="section" id="troubleshooting">
<h1>Troubleshooting</h1>
<blockquote>
<p>If neither the <tt class="docutils literal">java</tt> nor <tt class="docutils literal">javac</tt> commands work, first try closing the command window and opening a new one so that the command shell reads the PATH environment variable you just updated. If that does not work, double check that the folder you added to the Path variable contains executable files like <tt class="docutils literal">java</tt> and <tt class="docutils literal">javac</tt> on Unix, or <tt class="docutils literal">java.exe</tt> and <tt class="docutils literal">javac.exe</tt> on Windows.</p>
<p>If <tt class="docutils literal">java</tt> works but <tt class="docutils literal">javac</tt> does not, you probably installed a JRE (Java Runtime Environment), not a JDK. Return to Step 1 and start over.</p>
</blockquote>
</div>