Compiling JSystem to Java 7

Compiling JSystem to Java 7 

Check out the project

JSystem can run with Java 7 JRE or JDK, but it is compiled with the compliance level of Java 6. That means that you can’t run JSystem automation projects that were compiled with Java 7 compliance level so you can’t use all the (almost) cool new features. 

If you still want to make use of Java 7 features you will need to check out the JSystem project and compile it yourself. 

First, let’s check out the project. Follow the instructions that are described in the Compiling JSystem from Sources blog post, but make sure that you are downloading and configuring JDK 7.

Select the JSystem version

When checking out JSystem you get the latest and greatest code. On the other hand, this code was not fully tested and may be unstable. To select one of the more stable version you can check out one of the versions that are kept in Git tags. To see which tags are available open your operating system console and type the following commands:

[stextbox id=”grey“]

> cd git/jsystem

> git tag

[/stextbox]

To select one of the versions type git checkout <tag name>. For example:

[stextbox id=”grey“]> git checkout 6.0.00[/stextbox]

 

 

Change the project compliance level

Now that we have the project in our hands, we need to change the compliance level. Open  the  jsystem/jsystem-parent/pom.xml file with your favorite text editor and find the maven-compiler-plugin section. 

In the compiler plugin section change the target and source properties values from 1.6 to 1.7

[stextbox id=”grey“]
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>2.5.1</version>
    <configuration>
        <target>1.7</target>
        <source>1.7</source>
        <encoding>UTF-8</encoding>
    </configuration>
</plugin>
[/stextbox]

 Compile and assemble the project

To compile and assemble the project, open your operating system console and type the following commands:

[stextbox id=”grey“]

> cd git/jsystem/jsystem-parent

> mvn clean install -DskipTests=true

> cd ../jsystem-assembly/jsystem-runner

> mvn clean install

> cd target/runner/runner

> run.bat

[/stextbox]

If everything went well, the runner you have just launched fully Java 7 compatible… Go ahead, create a test that have a switch case on strings and see how the runner supports it nicely.

 

 

 

 

 

 

 

Fork me on GitHub