-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathindex.shtml
216 lines (180 loc) · 10.2 KB
/
index.shtml
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!DOCTYPE html>
<html lang="en">
<head>
<title>JMRI: JMRI and Java</title>
<meta name="author" content="John Plocher">
<meta name="keywords" content="java model railroad JMRI download binaries binary code jar install">
<!--#include virtual="/Style.shtml" -->
</head>
<body>
<!--#include virtual="/Header.shtml" -->
<div id="mBody">
<!--#include virtual="Sidebar.shtml" -->
<hr class="hide">
<div id="mainContent">
<h1>Using Java with JMRI</h1>
<p><b>We recommend using Java 17 with current JMRI versions starting with JMRI 5.9.1.
Although Java 11 will work, we recommend that you install Java 17 as it's more up to date.</b>
<p>Starting with JMRI 5.0 through JMRI 5.8, the required Java
version was Java 11.
JMRI 5 will not work with Java versions below Java 11.
Originally, there were a small number of
<a href="https://www.jmri.org/help/en/html/doc/Technical/JVMCapabilities.shtml#jdk17">known issues</a>
with later Java versions from JMRI 5.0 to JMRI 5.8.
These were resolved in JMRI 5.9.1, at which point we started recommending Java 17.
</p>
<p><em>JMRI needs a "Java Runtime Environment" (JRE) to run
but will work fine with the larger "Java Development Kit" (JDK).</em>
A JDK is only needed if you want to work on JMRI development, i.e. make changes and compile them.</p>
<p>Before getting a new version of Java, it is useful to check what version is currently installed
on your computer. On Windows, for example, open a "command" window by typing "Command prompt" into the search bar
next to the Windows Start icon. Then type:</p>
<code>java -version</code>
<p><strong>IT IS RECOMMENDED THAT YOU REMOVE OLD VERSIONS OF JAVA BEFORE YOU UPGRADE.</strong> This avoids a number of reported
problems. On Windows, for example, you can:
<ul>
<li>Go to Windows <strong>Settings⇒Apps</strong>, find Java 8 and click on <strong>"Uninstall."</strong></li>
<li>Alternatively, download the <a href="https://www.java.com/en/download/uninstalltool.jsp" target="_blank">Oracle Java Uninstall tool</a> and follow its instructions</li>
<li>It's recommended that you reboot after uninstalling before you install a new version of Java.</li>
</ul>
<p>See the <a href="../help/en/html/setup/">JMRI Setup and Install pages</a> for more information.</p>
<h1>Getting Java</h1>
<h2 id="linux_java">For Linux distributions</h2>
<p>Linux distributions should use the standard package manager. For Debian based distributions such
as Ubuntu, Mint, and Raspberry PI OS, the package manager is <strong><em>apt</em></strong>. For Red
Hat based distributions such as Fedora and CentOS, the package manager is <strong><em>dnf</em></strong>.</p>
<p>The following steps use the terminal command line. The <strong><em>apt</em></strong> and
<strong><em>dnf</em></strong> commands require root authority via sudo.</p>
<h3>Check for current Java installs.</h3>
<code>java -version</code>
<h4>Java was previously installed</h4>
<div class="noted">
<pre>
openjdk version "1.8.0_362"
OpenJDK Runtime Environment (build 1.8.0_362-8u362-ga-0ubuntu1~22.04-b09)
OpenJDK 64-Bit Server VM (build 25.362-b09, mixed mode)
</pre>
</div>
<p>The Java 1.8 version needs to be removed. That process is outside the scope of this document.
Search for <strong><em>linux remove java</em></strong>. The steps involved depend on the
distribution, the source and the Java version. An alternative is to use the local Java within
JMRI approach. See <a href="#local">Local Java</a></p>
<h4>Java has not been installed</h4>
<div class="noted">Debian based:
<pre>
Command 'java' not found, but can be installed with:
sudo apt install openjdk-17-jre-headless # version 17.0.6+10-0ubuntu1~22.04
</pre>
</div>
<div class="noted">Red Hat based:
<pre>
bash: java: command not found...
Install package 'java-17-openjdk-headless' to provide command 'java'? [N/y]
</pre>
Reply N, JMRI needs the full Java version.
</div>
<h3>Install Java 17</h3>
<p><code>sudo apt install openjdk-17-jre</code> Debian based</p>
<p><code>sudo dnf install java-17-openjdk</code> Red Hat based</p>
<h2>Java Installers for Windows, macOS or Linux 32-bit or 64-bit computers</h2>
This section describes two sources of Java installers for 32-bit or 64-bit
Windows and macOS machines.
These are our recommended solutions.
These can also be used for Linux if the above package-manager based solutions are not
available for some reason.
<ul>
<li>
<a href="https://www.azul.com/downloads/?version=java-17-lts&package=jre">Azul</a>
- Go to the bottom of the page, past the advertising, select
your OS type (Windows, macOS, Linux), then if needed the computer CPU
architecture (we recommend 64-bit if you have a 64-bit computer), then pick the
appropriate download from the page.
<p>Windows users should pick the ".msi" installer, as it properly
sets up various registry values. Rebooting after installing is recommended.</p>
<p>macOS users might find the Adoptium installer (next item)
easier to use than the Azul download.</p>
</li>
<li>
<a href="https://adoptium.net/?variant=openjdk17">Adoptium (Eclipse)</a>
- This website refers to a Java JDK as "Temurin", which is a bit confusing.
Make sure that "Temurin 17" is selected, then press the large "Latest Release" button.
<p>
On Windows: when you run the Java installer, be sure to select the "JavaSoft (Oracle) registry keys" option.
Rebooting after installing is recommended.</p>
<p>
On macOS: This will download a .pkg file. Double-click on it to run the installer.</p>
</li>
</ul>
<h2>Additional Source of Installers for 64-bit computers</h2>
If for some reason, the installers in the previous section are not
suitable, there are several other sources for Java installers for 64-bit
Windows, macOS and Linux computers:
<ul>
<li>
<a href="https://www.openlogic.com/openjdk-downloads?field_java_parent_version_target_id=406&field_operating_system_target_id=All&field_architecture_target_id=All&field_java_package_target_id=401">OpenLogic</a>
-
Select your OS type (Windows, macOS, Linux). OpenLogic only has a 64-bit version so make sure
you have a 64-bit computer. Pick a download from the page.
<p>
On Windows: when you run the Java installer, be sure to select the "JavaSoft (Oracle) registry keys" option.
Rebooting after installing is recommended.</li>
<li>
<a href="https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html">Oracle</a>
-
The original JDK source, but this page requires you to set up a (free) Oracle account. No JREs available.
<p>We recommend that Windows users pick the "Windows x64 Installer", as it properly sets up various registry values.</li>
<li>
<a href="https://developer.ibm.com/languages/java/semeru-runtimes/downloads/">IBM</a>
- They provide JDKs under the "Semeru" name. Follow the installation instructions
<em>exactly</em>.</li>
</ul>
<h2 id="local">Local install option</h2>
<span class="since">Since <a href="../releasenotes/jmri4.99.9.shtml">JMRI 4.99.9</a></span>
<p>Linux and macOS users can also install Java inside JMRI itself,
instead of installing it centrally on their computer.
This can be useful if you need different Java versions for other programs, or if for some reason
you can't do the central Java install or removal.</p>
<p>
We recommend installing Java as described on the top half of this page when possible.
The local-install described here is only for cases when that can't be done.
Note that you'll need to repeat this process every time you update JMRI,
as the local Java install will be overwritten during the update process.</p>
<h3>macOS</h3>
<p>On macOS, the process is:</p>
<ul>
<li>Install JMRI into the Applications folder in the usual way.</li>
<li>Download <a href="https://cdn.azul.com/zulu/bin/zulu17.50.19-ca-jre17.0.11-macosx_x64.zip">this Java install file</a>.</li>
<li>If this created a zulu17.50.19-ca-jre17.0.11-macosx_x64 folder in your Downloads folder, proceed to the next step.</li>
If this created a zulu17.50.19-ca-jre17.0.11-macosx_x64.zip file in your Downloads folder, double click on it to expand it to a folder.
<li>Rename that folder to just "jre".</li>
<li><a href="macOS_JRE.png"><img src="macOS_JRE.png" width="300" height="242" alt="JMRI/Applications folder" class="floatRight"></a>
Open the JMRI folder in the Applications folder (this is where you would normally launch JMRI)</li>
<li>Drag the jre folder from the Downloads folder to the JMRI folder.</li>
</ul>
<p>When you're done, the JMRI folder contents should look like the picture to the right.</p>
<p>
You're all set to start JMRI using that local version of Java!</p>
<h3>Linux</h3>
<p>On Linux, the process is:</p>
<ul>
<li>Download and place JMRI in the usual way.</li>
<li><a href="Linux_selection.png"><img src="Linux_selection.png" width="400" height="127" alt="Linux selection page" class="floatRight"></a>
Go to <a href="https://www.azul.com/downloads/?version=java-17-lts&package=jre">the Azul downloads page</a>
and scroll down to the selection box (see to the right).</li>
<li>Select your Linux type (RHEL, CentOS, Ubuntu, etc) and architecture (x86-64 bit, etc). Leave Java 17 and JRE selected.</li>
<li>Click on the .zip button (not any of the other ones!) to download onto your computer.</li>
<li>If this created a directory, proceed to the next step. If it downloaded a .zip file,
expand it into a directory before proceeding to the next step.</li>
<li>Rename the resulting directory to just "jre".</li>
<li>Open the JMRI folder you created in the first step (this is where you would normally launch JMRI)</li>
<li>Move the new jre directory into the JMRI folder.</li>
</ul>
<p>
You're all set to start JMRI using that local version of Java!</p>
<hr class="hide">
<!--#include virtual="/Footer.shtml" -->
</div> <!-- closes #mainContent-->
</div> <!-- closes #mBody-->
<script src="/js/main.js"></script>
</body>
</html>