11.3.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Guideline for Java 11.txt 2.45 KB
Newer Older
Timy Phan's avatar
Timy Phan committed
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
The java_migration branch has used the following steps to compile and run vadere with JDK-11 on Windows 10:

0. Ensure that JDK-11 and Git is set in the environment variables

1. Adjust the IDE (IntelliJ)
1.1 Select File -> Settings -> Build, Execution, Deployment -> Compiler -> Java Compiler
1.1.1 Select 11 for "Project bytecode version"
1.1.2 Select 1.11 in "Per-module bytecode version" for each module
1.2 Select File -> Project Structure -> Project Settings -> Modules
1.2.1 Select "11 ..." for "Language level" for each module

2. Adjust pom.xml
2.1 search for <properties>
2.1.1 Change <maven-compiler.[source|target].version> to 1.11
2.2 Insert:
  <build>
     <plugins>
        <plugin>
           <groupId>org.apache.maven.plugins</groupId>
               <artifactId>maven-enforcer-plugin</artifactId>
                <version>3.0.0-M1</version>
                <executions>
                    <execution>
                        <id>enforce-maven</id>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                        <configuration>
                            <rules>
                                <requireMavenVersion>
                                    <version>3.0</version>
                                </requireMavenVersion>
                        </rules>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                   <release>10</release>
                </configuration>
            </plugin>
        </plugins>
    </build>

3. Compile
3.1 Run "mvn -e clean test-compile compile" (-e for error stack trace)
3.* possibly required updates: "mvn versions:display-dependency-updates" and "mvn versions:display-plugin-updates"

4. Create local runtime
4.1 Run "jdeps --list-deps VadereGui/target/vadere.jar"
4.2 Run "jlink --no-header-files --no-man-pages --compress=2 --strip-debug --add-modules java.base,java.compiler,java.datatransfer,java.desktop,java.logging,java.management,java.naming,java.prefs,java.rmi,java.scripting,java.sql,java.xml --output java-runtime"
// The main output of jdeps is used as the parameter for jlink --add-modules.
4.3 Run "java-runtime/bin/java -jar VadereGui/target/vadere.jar"