0

The Java class was not found when the application was run on a test laptop. The following exception was thrown: screenshot of the exception

The test is run from an executable JAR file that was created in Eclipse on the development laptop. As I understand, the executable JAR should contain all support libraries.

When I run the executable JAR from the development laptop, I don't encounter the exception. It is encountered on the test system only. That's what is difficult to understand.

Secondly, I downloaded and added reference to activation-1.1.1.jar in the build path - but it did not help. The same exception is thrown.

So, I am scratching my head and looking for experts' help :)

Thanks.

S P
  • 101
  • 2
  • 13
  • This "As I understand, the executable JAR should contain all support libraries." is obviously incorrect. – SiKing Oct 01 '21 at 22:04
  • Please do not include images of text in a question. Text should be present in a question as a text block. – VGR Oct 01 '21 at 22:04
  • Your class path is probably not what you think it is. – Thorbjørn Ravn Andersen Oct 01 '21 at 22:04
  • @Thorbjørn Ravn Andersen - All libraries are in the same folder and that's how they are referred to in Eclipse (project > Build Path). So, I am not sure I understand your comment. – S P Oct 01 '21 at 22:13
  • @SiKing - I relied on Eclipse to include all libraries when I checked the option for "Package required libraries into generated JAR" for library handling. An option to selectively add libraries is not presented in the export process. – S P Oct 01 '21 at 22:16
  • You need to provide a class path at runtime too or use the one inside the jar with `-jar` – Thorbjørn Ravn Andersen Oct 01 '21 at 22:20
  • What vendor/version of Java do you have on the build machine and on the runtime machine? Not a duplicate, but have a read here https://stackoverflow.com/q/727844/3124333 – SiKing Oct 01 '21 at 22:20
  • @SiKing - I am using Open JDK 8 – S P Oct 04 '21 at 13:45
  • Do you understand what the classpath is and how it works? Including the fact that _nothing_ automatically saves your classpath at build time for later? – Thorbjørn Ravn Andersen Oct 05 '21 at 10:25
  • @Thorbjørn Ravn Andersen: Yes, and yes. On the command to run the executable jar, the classpath is set to include the correct path to the library in question. – S P Oct 05 '21 at 17:55

0 Answers0