Error with runnable jar outside of IDE

Asked by Ralph

Hi RaiMan, When I export a runnable jar from Eclipse I get an error when I run the jar outside of the IDE. The error happens when I use click, hover, findtext and exists functions. The errors I get are "java.lang.NoClassDefFoundError: Could not initialize class org.sikuli.script.Finder$FindInput2" and "Caused by: java.lang.NullPointerException: Cannot invoke "java.io.File.getAbsolutePath()" because "this.fSxBase" is null"

I read in some of the documentation that I may need to install Sikuli on the PC first but cannot find out how to do this. Any help would be appreciated

The OS is Windows 10. This is from the pom
<properties>
 <java.version>1.8</java.version>
 <selenium.version>3.13.0</selenium.version>
 <testng.version>7.4.0</testng.version>
 <maven.compiler.version>3.7.0</maven.compiler.version>
</properties>

<dependencies>
 <dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>${selenium.version}</version>
 </dependency>
 <dependency>
  <groupId>org.testng</groupId>
  <artifactId>testng</artifactId>
  <version>${testng.version}</version>
 </dependency>
 <dependency>
  <groupId>com.aventstack</groupId>
  <artifactId>extentreports</artifactId>
  <version>4.0.6</version>
 </dependency>
 <dependency>
  <groupId>com.sikulix</groupId>
  <artifactId>sikulixapi</artifactId>
  <version>2.0.4</version>
 </dependency>

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

Could you please try with version 2.0.5.

Be sure, that the runnable jar contains all the Sikulix API dependencies (fat jar).

Revision history for this message
Ralph (rnimbin) said :
#2

Thanks RaiMan, that solved my question.

Revision history for this message
Ralph (rnimbin) said :
#3

Hi RaiMan, much appreciated. Using a fat jar with 2.0.4 fixed this error