Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility with Java 13 #400

Merged
merged 19 commits into from
Feb 4, 2021
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ canvases
.idea
*.iml
*.class
*.java-version
*dockerfile
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
language: java
jdk: oraclejdk8
dist: trusty
jdk: openjdk13
dist: focal
services:
- xvfb
branches:
only:
- master
Expand Down
53 changes: 14 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,51 +16,19 @@ Paintera is a general visualization tool for 3D volumetric data and proof-readin

## Installation and Usage

Paintera is available for installation through [conda](#conda) and the [Python Package Index](#pip). Alternatively, you can use [jgo](#jgo) to run Paintera from an existing Maven artifact on the [SciJava Maven repository](https://maven.scijava.org) or your local maven repository, typically located at `$HOME/.m2` on your computer. For all of these options, Java 8 with JavaFX and Apache Maven are requirement. Efforts to create a standalone app have not been successful so far ([#253](https://github.com/saalfeldlab/paintera/issues/253)).
Paintera is available for installation through [conda](#conda) and the [Python Package Index](#pip). Alternatively, you can use [jgo](#jgo) to run Paintera from an existing Maven artifact on the [SciJava Maven repository](https://maven.scijava.org) or your local maven repository, typically located at `$HOME/.m2` on your computer. For all of these options, Java 11 and Apache Maven are required. Efforts to create a standalone app have not been successful so far ([#253](https://github.com/saalfeldlab/paintera/issues/253)).
cmhulbert marked this conversation as resolved.
Show resolved Hide resolved

### Dependencies

Java 8 (through [OpenJDK](https://openjdk.java.net/)), JavaFX, and Apache Maven are available for [installation on many Linux distributions](#installation-on-linux).

On Windows and macOS the use of [Oracle Java 8](https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) (comes with JavaFX) is recommended and [Apache Maven needs to be downloaded and installed](https://maven.apache.org) manually. Make sure that both Java and Maven are available on the `PATH` after installation. Note that our experience with Windows and macOS installations is very limited and there may be better ways to install Java 8 with JavaFX and Maven on these operating systems. If you are aware of any, please create a pull request to add these to this README.

Alternatively, OpenJDK and Maven are available through the default (`pkgs/main`) and `conda-forge` channels on [conda](https://conda.io), respectively.
OpenJDK and Maven are available through the default (`pkgs/main`) and `conda-forge` channels on [conda](https://conda.io), respectively.
```sh
conda install -c pkgs/main openjdk
conda install -c conda-forge maven
```
Note that OpenJDK on the `conda-forge` channels does not ship with JavaFX and cannot be used.
axtimwalde marked this conversation as resolved.
Show resolved Hide resolved


#### Installation on Linux

##### Arch Linux
```shell
pacman -S jdk8-openjdk
pacman -S java8-openjfx
pacman -S maven
```

##### Ubuntu
```shell
sudo apt install default-jre default-jdk
sudo apt install maven
sudo apt install openjfx
```

On Ubuntu 18.04, you will have to install OpenJFX 8 explicitly and then immediately pin this version:

```shell
sudo apt install openjfx=8u161-b12-1ubuntu2 libopenjfx-java=8u161-b12-1ubuntu2 libopenjfx-jni=8u161-b12-1ubuntu2
sudo apt-mark hold openjfx libopenjfx-java libopenjfx-jni
```
Alternatively, you can install Java 11 and Maven manually. Java 11 (through [OpenJDK](https://openjdk.java.net/)) and Apache Maven are available for [installation on many Linux distributions](#installation-on-linux).
cmhulbert marked this conversation as resolved.
Show resolved Hide resolved

If you are on 18.10 or newer, add the bionic repositories following instruction on https://bugs.launchpad.net/ubuntu/+source/openjfx/+bug/1799946:
```shell
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
sudo apt-add-repository 'deb http://de.archive.ubuntu.com/ubuntu/ bionic main'
sudo apt-add-repository 'deb http://de.archive.ubuntu.com/ubuntu/ bionic universe'
```
On Windows and macOS the use of [Oracle Java 11](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) is recommended and [Apache Maven needs to be downloaded and installed](https://maven.apache.org) manually. Make sure that both Java and Maven are available on the `PATH` after installation. Note that our experience with Windows and macOS installations is very limited and there may be better ways to install Java 11 and Maven on these operating systems. If you are aware of any, please create a pull request to add these to this README.
cmhulbert marked this conversation as resolved.
Show resolved Hide resolved

### Conda
Installation through conda requires an [installation of the conda package manager](https://docs.conda.io/projects/conda/en/latest/user-guide/install/).
Expand All @@ -87,11 +55,13 @@ PAINTERA_SLF4J_BINDING=ch.qos.logback:logback-classic paintera
```

### Pip
Note: If installing via pip, it will be necessary to have Java 11 and Maven installed manually.
cmhulbert marked this conversation as resolved.
Show resolved Hide resolved

Paintera is [available on the Python Package Index](https://pypi.org/project/paintera) and can be installed through pip ([`Python >= 3.6`](https://www.python.org) required):
```sh
pip install paintera
```
Generally, it is adivsable to install packages into user space with pip, i.e.
Generally, it is advisable to install packages into user space with pip, i.e.
```sh
pip install --user paintera
```
Expand All @@ -116,9 +86,13 @@ PAINTERA_SLF4J_BINDING=ch.qos.logback:logback-classic paintera
### Jgo
You can use [jgo](https://github.com/scijava/jgo) to run Paintera from an existing Maven artifact on the [SciJava Maven repository](https://maven.scijava.org) or your local maven repository, typically located at `$HOME/.m2` on your computer. Jgo is available through PyPI and conda. Please follow the instructions on the [jgo GitHub repository](https://github.com/scijava/jgo#the-python-module) for installation.

When using jgo manually, it is necessary to specify certain javafx specific JGO arguments manually. An example of running paintera via jgo on linux is shows below.
```sh
PLATFORM=linux # set to 'win' if Windows and 'mac' if MacOS
JAVAFX_JGO_ARGS="--module-dependencies org.openjfx:javafx-base:13.0.1 org.openjfx:javafx-base:13.0.1:${PLATFORM} org.openjfx:javafx-controls:13.0.1 org.openjfx:javafx-controls:13.0.1:${PLATFORM} org.openjfx:javafx-fxml:13.0.1 org.openjfx:javafx-fxml:13.0.1:${PLATFORM} org.openjfx:javafx-media:13.0.1 org.openjfx:javafx-media:13.0.1:${PLATFORM} org.openjfx:javafx-swing:13.0.1 org.openjfx:javafx-swing:13.0.1:${PLATFORM} org.openjfx:javafx-web:13.0.1 org.openjfx:javafx-web:13.0.1:${PLATFORM} org.openjfx:javafx-graphics:13.0.1 org.openjfx:javafx-graphics:13.0.1:${PLATFORM} --illegal-access=permit --add-opens=javafx.base/javafx.util=ALL-UNNAMED --add-opens=javafx.base/javafx.event=ALL-UNNAMED --add-opens=javafx.base/javafx.beans.property=ALL-UNNAMED --add-opens=javafx.base/com.sun.javafx.binding=ALL-UNNAMED --add-opens=javafx.base/com.sun.javafx.event=ALL-UNNAMED --add-opens=javafx.graphics/javafx.scene=ALL-UNNAMED --add-opens=javafx.graphics/javafx.stage=ALL-UNNAMED --add-opens=javafx.graphics/javafx.geometry=ALL-UNNAMED --add-opens=javafx.graphics/javafx.animation=ALL-UNNAMED --add-opens=javafx.graphics/javafx.scene.input=ALL-UNNAMED --add-opens=javafx.graphics/javafx.scene.image=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.prism=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.geom=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.image=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.scene=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.stage=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.perf=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.cursor=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.tk=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.scene.traversal=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.geom.transform=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.scenario.animation=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.scenario.animation.shared=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.scenario.effect=ALL-UNNAMED --add-opens=javafx.graphics/com.sun.javafx.sg.prism=ALL-UNNAMED --add-modules javafx.base,javafx.controls,javafx.fxml,javafx.media,javafx.swing,javafx.web,javafx.graphics"
cmhulbert marked this conversation as resolved.
Show resolved Hide resolved
jgo \
[JGO ARG...] [JVM ARG...] \
[JVM ARGS...] [ADDITIONAL JGO ARGS...] \
${JAVAFX_JGO_ARGS} -- \
-r scijava.public=https://maven.scijava.org/content/groups/public \
org.janelia.saalfeldlab:paintera[:$VERSION][+org.slf4j:slf4j-simple:1.7.25]
```
Expand All @@ -133,7 +107,8 @@ git checkout <branch-name>
mvn clean install
# maven will log the version it installs. Replace <VERSION> below with that version
jgo \
[JGO ARG...] [JVM ARG...] \
[JVM ARGS...] [ADDITIONAL JGO ARGS...] \
${JAVAFX_JGO_ARGS} -- \
org.janelia.saalfeldlab:paintera:<VERSION>+org.slf4j:slf4j-simple:1.7.25
```
The `-r` flag can be ommitted here because Paintera is available in the local maven repository.
Expand Down
9 changes: 4 additions & 5 deletions create-changelog.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ data class Change(
val author: String,
val message: String,
val date: String) {
constructor(commit: JSONObject) : this(
sha = commit.getString("sha"),
author = (commit["author"] as JSONObject).getString("login"),
message = (commit["commit"] as JSONObject).getString("message"),
date = (((commit["commit"] as JSONObject)["author"] as JSONObject)).getString("date"))
constructor(commit: JSONObject) : this(sha = commit.getString("sha"),
author = if (commit.isNull("author")) "NULL" else (commit["author"] as JSONObject).getString("login"),
message = (commit["commit"] as JSONObject).getString("message"),
date = if (commit.isNull("author")) "NULL" else (((commit["commit"] as JSONObject)["author"] as JSONObject)).getString("date"))
}

fun versionFromString(str: String): Version {
Expand Down
Loading