Skip to content

Commit c225533

Browse files
authored
Rewrite guidelines to Java 15 (JabRef#6973)
1 parent 4b1b7b4 commit c225533

File tree

3 files changed

+41
-21
lines changed

3 files changed

+41
-21
lines changed
83.5 KB
Loading
36.5 KB
Loading

docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md

Lines changed: 41 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This guide explains how to set up your environment for development of JabRef. It
44

55
```text
66
The most important step is to configure your IDE.
7-
In case you know how to install JDK14 with JavaFX support and to fork JabRef's code,
7+
In case you know how to install JDK15 with JavaFX support and to fork JabRef's code,
88
please scroll down to the IDE setup.
99
```
1010

@@ -16,13 +16,14 @@ For a complete step-by-step guide for Linux using IntelliJ IDEA as the IDE, have
1616

1717
This section list the prerequisites you need to get started to develop JabRef. After this section, you are ready to get the code.
1818

19-
### Java Development Kit 14
19+
### Java Development Kit 15
2020

21-
A working Java \(Development Kit\) 14 installation with Java FX support is required. In the command line \(terminal in Linux, cmd in Windows\) run `javac -version` and make sure that the reported version is Java 14 \(e.g `javac 14`\). If `javac` is not found or a wrong version is reported, check your PATH environment variable, your `JAVA_HOME` environment variable or install the most recent JDK.
21+
A working Java \(Develoment Kit\) 15 installation with Java FX support is required. In the command line \(terminal in Linux, cmd in Windows\) run `javac -version` and make sure that the reported version is Java 15 \(e.g `javac 15`\). If `javac` is not found or a wrong version is reported, check your `PATH` environment variable, your `JAVA_HOME` environment variable or install the most recent JDK.
2222

23-
[JavaFX is not part of the default JDK any more](https://www.reddit.com/r/java/comments/82qm9x/javafx_will_be_removed_from_the_java_jdk_in_jdk_11/), it needs to be installed separately if not using a special JDK. We recommend to setup the full Liberica JDK including JavaFX. You can get it from [https://bell-sw.com/pages/downloads/?version=java-14&package=jdk-full](https://bell-sw.com/pages/downloads/?version=java-14&package=jdk-full). On Windows, you can execute `choco install libericajdkfull` \(requires [installation of chocolatey - a package manager for Windows](https://chocolatey.org/install)\).
23+
[JavaFX is not part of the default JDK any more](https://www.reddit.com/r/java/comments/82qm9x/javafx_will_be_removed_from_the_java_jdk_in_jdk_11/), it needs to be installed separately if not using a special JDK. ~~We recommend to setup the full Liberica JDK including JavaFX. You can get it from [https://bell-sw.com/pages/downloads/?version=java-15&package=jdk-full](https://bell-sw.com/pages/downloads/?version=java-15&package=jdk-full). On Windows, you can execute `choco install libericajdkfull` \(requires [installation of chocolatey - a package manager for Windows](https://chocolatey.org/install)\).~~ (Liberica JDK 15 does not include the Java compiler properly any more)
2424

25-
Alternatively, you can download and install the JDK from [https://jdk.java.net/](https://jdk.java.net/). Afterwards, download download the "jmods" JavaFX 14 zip archive from [https://gluonhq.com/products/javafx/](https://gluonhq.com/products/javafx/) and put the `.jmod` files into `C:\Program Files\OpenJDK\jdk-14.0.1\jmods`.
25+
Download and install the JDK from [https://jdk.java.net/](https://jdk.java.net/).
26+
Afterwards, download the "jmods" JavaFX 15 zip archive from [https://gluonhq.com/products/javafx/](https://gluonhq.com/products/javafx/) and put the `.jmod` files into `C:\Program Files\OpenJDK\jdk-15\jmods`.
2627

2728
### GitHub Account
2829

@@ -54,9 +55,18 @@ It is strongly recommend that you have git installed.
5455

5556
### IDE
5657

57-
We suggest [IntelliJ IDEA](https://www.jetbrains.com/idea/) or [Eclipse \(for advanced users\)](https://eclipse.org/) \(`2020-03` or newer\).
58+
We suggest [IntelliJ IDEA](https://www.jetbrains.com/idea/).
59+
For advanced users, [Eclipse](https://eclipse.org/) \(`2020-09` or newer\) is also possible.
5860

59-
On Ubuntu Linux, you can follow the [documentation from the Ubuntu Community](https://help.ubuntu.com/community/EclipseIDE#Download_Eclipse) or the [step-by-step guideline from Krizna](https://www.krizna.com/ubuntu/install-eclipse-in-ubuntu-12-04/) to install Eclipse. Under Windows, download it from [www.eclipse.org](http://www.eclipse.org/downloads/) and run the installer.
61+
#### IntelliJ
62+
63+
We recommend to install IntelliJ IDEA using [JetBrains Toolbox App](https://www.jetbrains.com/toolbox-app/), because IDE updates are automatically installed.
64+
65+
#### Ecipse
66+
67+
On Ubuntu Linux, you can follow the [documentation from the Ubuntu Community](https://help.ubuntu.com/community/EclipseIDE#Download_Eclipse) or the [step-by-step guideline from Krizna](https://www.krizna.com/ubuntu/install-eclipse-in-ubuntu-12-04/) to install Eclipse. On Windows, download it from [www.eclipse.org](http://www.eclipse.org/downloads/) and run the installer.
68+
69+
Eclipse JEE 2020-09 or newer is required. For Eclipse 2020-09 you need to install [Java 15 Support](https://marketplace.eclipse.org/content/java-15-support-eclipse-2020-09-417).
6070

6171
### Other Tooling
6272

@@ -86,22 +96,23 @@ This section explains how you get the JabRef code onto your machine in a form al
8696

8797
These steps are very important. They allow you to focus on the content and ensure that the code formatting always goes well. Did you know that [IntelliJ allows for reformatting selected code](https://www.jetbrains.com/help/idea/reformat-and-rearrange-code.html#reformat_code) if you press Ctrl+Alt+L?
8898

89-
### Setup for IntelliJ IDEA
90-
91-
We recommend to install IntelliJ IDEA using [JetBrains Toolbox App](https://www.jetbrains.com/toolbox-app/), because IDE updates are automatically installed.
99+
### Configuration of IntelliJ IDEA
92100

93101
IntelliJ IDEA fully supports Gradle as a build tool, but also has an internal build system which is usually faster. For JabRef, Gradle is required to make a full build but once set up, IntelliJ IDEA's internal system can be used for sub-sequent builds.
94102

95103
To configure IntelliJ IDEA for developing JabRef, you should first ensure that you have enabled both bundled plugins _Gradle_ and _Gradle Extension_:
96104

97105
* Navigate to **File \| Settings \| Plugins \| Installed** and check that you have the _Gradle_ and _Gradle Extension_ enabled.
98106

99-
After that, you can open `jabref/build.gradle` as a project. It is crucial that Java 14 is used consistently for the JabRef project which includes ensuring the right settings for your project structure, Gradle build, and run configurations.
107+
After that, you can open `jabref/build.gradle` as a project. It is crucial that Java 15 is used consistently for the JabRef project which includes ensuring the right settings for your project structure, Gradle build, and run configurations.
108+
109+
Ensure you have a Java 15 SDK configured by navigating to **File \| Project Structure \| Platform Settings \| SDKs**. If you don't have one, add a new Java JDK and point it to the location of a JDK 15.
110+
![Project Settings](../.gitbook/assets/intellij-choose-jdk-adoptopenjdk-on-windows-project-settings.png)
100111

101-
Ensure you have a Java 14 SDK configured by navigating to **File \| Project Structure \| Platform Settings \| SDKs**. If you don't have one, add a new Java JDK and point it to the location of a JDK 14:
112+
Navigate to **File \| Project Structure \| Project** and ensure that the projects' SDK is Java 15
113+
![Use JDK 15 as project SDK](../.gitbook/assets/intellij-choose-jdk15-project-default.png)
102114

103-
* Navigate to **File \| Project Structure \| Project** and ensure that the projects' SDK is Java 14
104-
* Navigate to **File \| Settings \| Build, Execution, Deployment \| Build Tools \| Gradle** and select the Java 14 SDK as the Gradle JVM at the bottom.
115+
Navigate to **File \| Settings \| Build, Execution, Deployment \| Build Tools \| Gradle** and select the "Project SDK" as the Gradle JVM at the bottom.
105116

106117
To prepare IntelliJ's build system two additional steps are required:
107118

@@ -174,15 +185,24 @@ Contributions to JabRef's source code need to have a code formatting that is con
174185
* Go to **File \| Settings \| Editor \| Code Style**
175186
* Click on the settings wheel \(next to the scheme chooser\), then click "Import Scheme"
176187
* Select the IntelliJ configuration file `config/IntelliJ Code Style.xml`
177-
* Go to **File \| Settings \| Tools \| Checkstyle \| Configuration File** 1. Import the CheckStyle configuration file by clicking the \[+\] button 2. For the description provide "JabRef" 3. Click "Browse" and choose `config/checkstyle/checkstyle.xml` 4. Click "Next" and "Finish" 5. Activate the CheckStyle configuration file by ticking it in the list 6. Ensure that the [latest CheckStyle version](https://checkstyle.org/releasenotes.html) is selected \(8.36 or higher\). 8.36 is required for Java 14. 7. Set the "Scan Scope" to "Only Java sources \(including tests\) 8. Save settings by clicking "OK" 9. Your configuration should now look like this:
178188

179-
```text
189+
Finally, ensure that the checkstyle configuration file is in place:
190+
191+
1. Go to **File \| Settings \| Tools \| Checkstyle \| Configuration File**
192+
2. Import the CheckStyle configuration file by clicking the \[+\] button
193+
3. For the description provide "JabRef"
194+
4. Click "Browse" and choose `config/checkstyle/checkstyle.xml`
195+
5. Click "Next" and "Finish"
196+
6. Activate the CheckStyle configuration file by ticking it in the list
197+
7. Ensure that the [latest CheckStyle version](https://checkstyle.org/releasenotes.html) is selected \(8.36 or higher\). 8.36 is required for Java 15.
198+
8. Set the "Scan Scope" to "Only Java sources \(including tests\)
199+
9. Save settings by clicking "OK"
200+
10. Your configuration should now look like this:
180201
![checkstyle settings](../.gitbook/assets/intellij-checkstyle-settings.png)
181-
```
182202

183203
### Setup for Eclipse
184204

185-
Make sure your Eclipse installation us up to date, Eclipse JEE 2020-03 or newer is required. For Eclipse 2020-03 you need to install [jdk14 support](https://marketplace.eclipse.org/content/java-14-support-eclipse-2020-03-415)
205+
Make sure your Eclipse installation us up to date.
186206

187207
1. Run `./gradlew run` to generate all resources and to check if JabRef runs.
188208
* The JabRef GUI should finally appear.
@@ -234,7 +254,7 @@ Got it running? GREAT! You are ready to lurk the code and contribute to JabRef.
234254
235255
### Java installation
236256
237-
An indication that `JAVA_HOME` is not correctly set or no JDK 14 is installed is following error message:
257+
An indication that `JAVA_HOME` is not correctly set or no JDK 15 is installed is following error message:
238258
239259
```text
240260
compileJava FAILED
@@ -261,9 +281,9 @@ In rare cases you might encounter problems due to out-dated automatically genera
261281
There might be problems with building if you have openjfx libraries in local maven repository, resulting in errors like this:
262282

263283
```text
264-
> Could not find javafx-fxml-14-mac.jar (org.openjfx:javafx-fxml:14).
284+
> Could not find javafx-fxml-15-mac.jar (org.openjfx:javafx-fxml:15).
265285
Searched in the following locations:
266-
file:<your local maven repository path>/repository/org/openjfx/javafx-fxml/14/javafx-fxml-14-mac.jar
286+
file:<your local maven repository path>/repository/org/openjfx/javafx-fxml/15/javafx-fxml-15-mac.jar
267287
```
268288

269289
As a workaround, you can remove all local openjfx artifacts by deleting the whole openjfx folder from specified location.

0 commit comments

Comments
 (0)