I collect jar through maven and ran into a problem, namely with the path to the phantomjs binary. Ubuntu os

((DesiredCapabilities) caps).setCapability("phantomjs.binary.path", Server.class.getResource("/phantomjs").getPath()); 

Here is the project tree

project tree

This path gives the logger:

 INFO: executable: /home/vitaly/IdeaProjects/ValeoServer10bet/target/classes/phantomjs 

If you run the project through IDE (Intellij), then everything works fine, but if I launch the jar through the console, I get an error.

 sudo java -cp /home/vitaly/IdeaProjects/ValeoServer10bet/target/ValeoServer10bet-1.0-SNAPSHOT-jar-with-dependencies.jar com.valeobet.server.Server Exception in thread "main" java.lang.IllegalStateException: The driver executable does not exist: /home/vitaly/file:/home/vitaly/IdeaProjects/ValeoServer10bet/target/ValeoServer10bet-1.0-SNAPSHOT-jar-with-dependencies.jar!/phantomjs 

How to build a project, I do not understand .. Help, thank you

  • one
    suppose that the executable calls the OS, but it doesn’t know how to look inside your dzharnik - etki
  • @Etki hmmm, interesting, thanks for the tip, I will think - jessez

0