Skip to content

Commit

Permalink
Minor tweaks for the release of Version 1.0. Simplify guidance for ru…
Browse files Browse the repository at this point in the history
…nning on Ubuntu. Add known issues. Fix the appearance of the initial prompt with redfront colouring. Add Run-REDUCE-FX.png.
  • Loading branch information
fjwright committed May 27, 2020
1 parent 2475389 commit 487a76a
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 85 deletions.
129 changes: 52 additions & 77 deletions docs/InstallationGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,20 @@ suitable configuration it **should** run on any platform that supports
JavaFX 8 or later, but I can only test on Windows 10 and 64-bit Ubuntu
18.

You need to have a Java Runtime Environment (JRE) and JavaFX libraries
installed, both version 8 or later. Oracle JRE 8, available from
java.com, includes JavaFX 8, but other JRE versions normally do not,
in which case you need to install JavaFX separately. See below for
more specific details.

You also need to download the file `Run-REDUCE-FX.jar`. The easiest
You also need a suitable Java environment and I recommend installing
Java from java.com, which in my experience seems to be the easiest to
install and to work best. (To be more specific, you need to have a
Java Runtime Environment (JRE) and JavaFX libraries installed, both
version 8 or later. The version of Java available from java.com is
Oracle JRE 8, which includes JavaFX 8, whereas other JRE versions
normally do not, in which case you need to install JavaFX separately.)

You also need to download the file *Run-REDUCE-FX.jar*. The easiest
way to do this is to click on the download link at the top of the
[Run-REDUCE-FX web page](https://fjwright.github.io/Run-REDUCE-FX/).
(Alternatively, you can click on the `release` tab on the [GitHub
(Alternatively, you can click on the *release* tab on the [GitHub
project page](https://github.com/fjwright/Run-REDUCE-FX), then click
on `Run-REDUCE-FX.jar` under `Assets`.) Save `Run-REDUCE-FX.jar`
on *Run-REDUCE-FX.jar* under *Assets*.) Save *Run-REDUCE-FX.jar*
somewhere convenient, such as your home directory or the directory in
which you store your REDUCE projects. You can then run Run-REDUCE-FX
as an executable file by double-clicking on it or by executing the
Expand All @@ -35,25 +37,23 @@ in the directory containing the file. The latter approach has the
advantage that any error messages will be displayed in the shell
window.

There are many ways to run JavaFX applications. Here are some
specific recommendations that I have tested.
Here are some specific recommendations that I have tested.


## Microsoft Windows

`Run-REDUCE-FX` behaves very much like a drop-in replacement for
`Run-REDUCE`. So if you ran the latter on your computer then you can
probably run the former in the same way. If necessary, you can
install a suitable Java 8 JRE, which includes JavaFX 8, very easily
from [java.com](https://www.java.com/). This sets up Java so that
`Run-REDUCE-FX.jar` runs automatically by opening it, e.g. by
Run-REDUCE-FX behaves very much like a drop-in replacement for
Run-REDUCE. So if you ran the latter on your computer then you can
probably run the former in the same way. Installing Java from
[java.com](https://www.java.com/) sets it up so that
*Run-REDUCE-FX.jar* runs automatically when you open it, e.g. by
double-clicking on it.

An easy way to run Run-REDUCE-FX using a shell command is first to
open File Explorer and navigate to the folder to which you downloaded
`Run-REDUCE-FX.jar`. In the address bar, type `cmd` and then press
the *Return* key. This will open a Command Prompt window in the
current folder.
open *File Explorer* and navigate to the folder to which you
downloaded *Run-REDUCE-FX.jar*. In the address bar, type `cmd` and
then press the *Return* key. This will open a Command Prompt window
in the current folder.


## Ubuntu and other Platforms
Expand All @@ -63,75 +63,50 @@ other versions of Debian Linux, on which Ubuntu is based, and to a
lesser extent to other flavours of Linux and other platforms, such as
macOS.

### Install Oracle JRE 8 from the Web

Visit java.com, click on Java Download, then select Linux or Linux x64
as appropriate. There are installation instructions on this web site,
which you may find useful. (On versions of Linux based on Red Hat,
you may prefer to select the appropriate RPM distribution and install
that.) Download the appropriate `tar.gz` archive file and move it to
an appropriate installation directory, which I will assume is your
home directory `~`. Extract the contents of the archive, which you
can do easily by double-clicking on it to run Archive Manager (or see
the instructions on the web).
Visit java.com, click on *Java Download*, then select *Linux* or
*Linux x64* as appropriate. There are installation instructions on
this web site, which you may find useful. (On versions of Linux based
on Red Hat, you may prefer to select the appropriate RPM distribution
and install that.) Download the appropriate *tar.gz* archive file and
move it to an appropriate installation directory, which I will assume
is your home directory *~*. Extract the contents of the archive,
which you can do easily by double-clicking on it to run *Archive
Manager* (or see the instructions on the web).

An easy way to run Run-REDUCE-FX using a shell command is first to
open Files and navigate to the directory to which you downloaded
`Run-REDUCE-FX.jar`. Right-click on this directory and select *Open
in Terminal*. You can now run `Run-REDUCE-FX.jar` by executing the
open *Files* and navigate to the directory to which you downloaded
*Run-REDUCE-FX.jar*. Right-click on this directory and select *Open
in Terminal*. You can now run *Run-REDUCE-FX.jar* by executing the
shell command

~/jre1.8.0_251/bin/java -jar Run-REDUCE-FX.jar

Alternatively, if you add the directory `~/jre1.8.0_251/bin` to your
PATH, you can run Run-REDUCE-FX by executing the simpler shell command
where `jre1.8.0_251` is the name of the Java directory you just
installed. Alternatively, if you add the directory
`~/jre1.8.0_251/bin` to your PATH, you can run Run-REDUCE-FX by
executing the simpler shell command

java -jar Run-REDUCE-FX.jar

### Install OpenJDK JRE 11 plus OpenJFX 11 using a Package Manager

Open the Synaptic Package Manager from Activities, search for `jdk`,
mark `openjdk-11-jre` for installation and accept its dependencies.
Then search for `jfx`, mark `openjfx` for installation and accept its
dependencies (but you can deselect `openjfx-source`). Then click
Apply.

You can now run Run-REDUCE-FX as described above, except that the
shell command is

java --module-path /usr/share/openjfx/lib --add-modules javafx.controls,javafx.fxml -jar Run-REDUCE-FX.jar

You could simplify this command by putting it into a shell script file
or making it into a shell alias.

### Install OpenJDK JRE 11 plus OpenJFX 11 from the Web
### Known Issues

Visit [AdoptOpenJDK](https://adoptopenjdk.net/), click on the *Other
platforms* button (immediately below the *Latest release* button) and
select OpenJDK 11 (LTS). (The default JVM, HotSpot, should be fine.)
Select and/or scroll down to find your platform. On the right, choose
the JRE version (the JDK version will also work, but is much bigger
and irrelevant unless you do Java development), download an
appropriate installation file and install it. (The default
installation should be fine.)
On my main Windows computer, which has an HD display, I find that I
need to use a larger REDUCE I/O font size than I would expect. (A
font with the same numerical size appears smaller than in Run-REDUCE.)
This may be because JavaFX font sizes don't reflect display scaling.

Visit [OpenJFX](https://openjfx.io/), scroll down and click on the
*Download* button. Scroll down and download JavaFX Linux SDK, then
set it up by [following these
instructions](https://openjfx.io/openjfx-docs/#install-javafx). An
easy way to run Run-REDUCE-FX using a shell command is first to open
*Files* and navigate to the directory to which you downloaded
`Run-REDUCE-FX.jar`. Right-click on this directory and select *Open
in Terminal*. You can now run `Run-REDUCE-FX.jar` as described above.
On my Linux computer, which currently runs Ubuntu 18.04.4 LTS, I
notice the following issues, which may arise more generally.

### Bugs on Ubuntu 18.04.4 LTS
I find that any attempt to access documentation via the Help menu just
hangs. (This seems to happen in the *java.awt.Desktop.open* and
*java.awt.Desktop.browse* methods, which ultimately hang in native
methods in *sun.awt.X11.XDesktopPeer*.)

I get a warning when the application starts and dialogue boxes jump
unpleasantly as they open, but adding
I also get a warning when the application starts. Adding

-Djdk.gtk.version=2

to the command used to run Run-REDUCE-FX avoids both problems.
However, any attempt to access documentation via the Help menu just
hangs in the *java.awt.Desktop.open* and *java.awt.Desktop.browse* methods.
The ultimate cause seems to be a hang in a native method in *sun.awt.X11.XDesktopPeer*.
before `-jar` in the command used to run Run-REDUCE-FX avoids this
warning, but you may then find that dialogues do not appear where you
expect them.
Binary file added docs/Run-REDUCE-FX.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 9 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
## [Click Here to Download Run-REDUCE-FX.jar](https://github.com/fjwright/Run-REDUCE-FX/releases/latest/download/Run-REDUCE-FX.jar)

Run-REDUCE-FX is a Graphical User Interface for running the REDUCE
Computer Algebra System that provides a consistent user experience
across all platforms. It is implemented in JavaFX and the executable
application takes the form of the JAR file `Run-REDUCE-FX.jar`. Click
on the link above to download the latest release.
Computer Algebra System that should provide a consistent user
experience across all platforms. It is implemented in JavaFX and the
executable application takes the form of the JAR file
*Run-REDUCE-FX.jar*. Click on the link above to download the latest
release.

![Run-REDUCE-FX screen shot](Run-REDUCE-FX.png "Run-REDUCE-FX screen shot")

Expand All @@ -19,6 +20,10 @@ information about how to use Run-REDUCE-FX please see the [User
Guide](src/fjwright/runreduce/UserGuide.html) (which is also included
in Run-REDUCE-FX and easily accessible via the Help menu).

This version of Run-REDUCE-FX runs well on Microsoft Windows, but may
run less well on other platforms; see *Known Issues* at the end
of the [Installation Guide](docs/InstallationGuide.md).

Run-REDUCE-FX is still under development but here are the key features
that it currently provides:

Expand Down
2 changes: 1 addition & 1 deletion src/fjwright/runreduce/REDUCEPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ private void processOutput(String text, int textLength) {
});
}

private static final Pattern PATTERN = Pattern.compile("\n1: ");
private static final Pattern PATTERN = Pattern.compile("\n1:"); // works better than "\n1: "

private void processPromptMarkers(String text, int start, List<Text> textList) {
// Delete the very first prompt. (This code may not be reliable!)
Expand Down
2 changes: 1 addition & 1 deletion src/fjwright/runreduce/RunREDUCEFrame.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<MenuItem mnemonicParsing="false" onAction="#userGuideMenuItemAction" text="Run-REDUCE User Guide" />
<SeparatorMenuItem mnemonicParsing="false" />
-->
<MenuItem mnemonicParsing="false" onAction="#aboutMenuItemAction" text="About Run-REDUCE" />
<MenuItem mnemonicParsing="false" onAction="#aboutMenuItemAction" text="About Run-REDUCE-FX" />
</Menu>
</MenuBar>
</top>
Expand Down
4 changes: 2 additions & 2 deletions src/fjwright/runreduce/RunREDUCEFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private void initialize() {
int helpMenuItemIndex = 0;

if (desktop.isSupported(Desktop.Action.BROWSE)) {
MenuItem userGuideMenuItem = new MenuItem("Run-REDUCE User Guide");
MenuItem userGuideMenuItem = new MenuItem("Run-REDUCE-FX User Guide");
helpMenu.getItems().add(helpMenuItemIndex++, userGuideMenuItem);
userGuideMenuItem.setOnAction(e -> showUserGuide(desktop));
}
Expand Down Expand Up @@ -481,7 +481,7 @@ private void aboutMenuItemAction() {
"Version 1.0, May 2020\n" +
"\u00A9 2020 Francis Wright");
alert.initOwner(RunREDUCE.primaryStage);
alert.setTitle("About Run-REDUCE");
alert.setTitle("About Run-REDUCE-FX");
alert.setHeaderText("Run REDUCE in a JavaFX GUI");
alert.showAndWait();
}
Expand Down

0 comments on commit 487a76a

Please sign in to comment.