Unable to build modules from the example repo

version: 7.9.10
os: win 7 pro
ide: intelliJ

Hey everyone,

I'm new to these territories of Ignition and I'm following:
https://docs.inductiveautomation.com/display/SE/Environment+Setup

I'm using chocolatey as my package manager.
I successfully cloned the example repo:
git clone https://github.com/inductiveautomation/ignition-sdk-examples.git

I launched the IDE via pom.xml it looks like all dependencies are downloaded and cached.

Then when I run mvn package from git or cmd I get an error about class 55.0 should be 52.0
error:

class file has wrong version 55.0, should be 52.0
Please remove or make sure it appears in the correct subdirectory of the classpath.

Additional notes with regards to Environment Setup - Ignition SDK Programmer's Guide - Ignition Documentation
Step 1: "You will need Java JDK 1.8+..."
Is this required because when I used chocolatey to install maven it forced me to download jdk 18.0_211?

Step 3: "you will want a running version of Ignition..."
This step doesn't specify what version, but the git repo's readme.md states "A running, 8.0+ version of Ignition" as a requirement.

The docs are a bit out of date, you need JDK 11, which is what that error is about.

1 Like

@Kevin.Herron thank you!

To anyone else experiencing the same issue; after installing jdk 11 you’ll need to update your JAVA_HOME environment variables and point to the jdk11 install directory. I restarted git/bash and was able to the build the module.

2 Likes

While that fixed the build of the expression sample. I'm getting a different error when building the scripting example (which is the one I'm really after).

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Z:/SHARED/ignitionDev/ignition-sdk-examples/scripting-function/scripting-function-gateway/src/main/java/com/inductiveautomation/ignition/examples/scripting/GatewayHook.java:[43,5] method does not override or implement a method from a supertype
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for scripting-function 1.0.0-SNAPSHOT:
[INFO]
[INFO] scripting-function ................................. SUCCESS [ 0.127 s]
[INFO] scripting-function-common .......................... SUCCESS [01:19 min]
[INFO] scripting-function-client .......................... SUCCESS [ 18.879 s]
[INFO] scripting-function-designer ........................ SUCCESS [ 8.095 s]
[INFO] scripting-function-gateway ......................... FAILURE [ 28.707 s]
[INFO] scripting-function-build ........................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:20 min
[INFO] Finished at: 2019-04-30T13:14:50-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.2:compile (default-compile) on project scripting-function-gateway: Compilation failure
[ERROR] /Z:/SHARED/ignitionDev/ignition-sdk-examples/scripting-function/scripting-function-gateway/src/main/java/com/inductiveautomation/ignition/examples/scripting/GatewayHook.java:[43,5] method does not override or implement a method from a supertype

This one isn’t your fault, the scripting example needed to be updated. I just pushed the fix and it should compile now once you pull the changes in.

1 Like

I'm just cowboy'ing over here and decided to delete:

@Override
public Object getRPCHandler(......)

I got the module to build, but then noticed the method did not work (no RPC handler lol)

@Kevin.Herron, pulled the changes and it built. Thanks!

How do I build this module for a 7.9.10 install?
I tried modifying the parent pom.xml
from:
<ignition-platform-version>8.0.0</ignition-platform-version>
to:
<ignition-platform-version>7.9.10</ignition-platform-version>

[ERROR] Failed to execute goal on project scripting-function-gateway: Could not resolve dependencies for project com.inductiveautomation.ignition.examples:scripting-function-gateway:jar:1.0.0-SNAPSHOT: Could not find artifact org.eclipse.milo:sdk-client:jar:0.1.0-SNAPSHOT in snapshots (https://nexus.inductiveautomation.com/repository/inductiveautomation-snapshots)

I also tried using 7.9.0 with the same results. My thought behind that was if I can import modules to a 8.0.1-rc1 gateway using 8.0.0 as the ignition-platform-version then 7.9.0 would work with all 7.9.*
Unfortunately, that wasn't the case.

There’s a branch in that repo called ignition-7.9 that has the 7.9 version of the examples: https://github.com/inductiveautomation/ignition-sdk-examples/tree/ignition-7.9

Changing the SDK version is not enough, some examples don’t even exist and others have been changed quite a bit.

1 Like

Thanks @Kevin.Herron. I was able to build the 7.9 scripting example using the correct branch.

1 Like