Vaadin Chart's SVGGenerator using phantom JS in Linux 64-bit production env

I have deployed web application that includes Vaadin Chart’s SVGGenerator using phantom JS in Linux 64-bit production environment.

Product version:

com.vaadin vaadin-charts 4.2.0

Downloaded phantomjs-2.1.1-linux-x86_64.tar.bz2 and extract the content at “/opt/tomcat/webapps/myapp”

Below is my code:

System.setProperty(“phantom.exec”, “opt/tomcat/webapps/myapp/phantomjs-2.1.1-linux-x86_64/bin/phantomjs”);

I got following issue.
java.lang.NullPointerException: null
at com.vaadin.addon.charts.util.SVGGenerator.startPhantomJS( ~[vaadin-charts-4.2.0.jar:4.2.0]

        at com.vaadin.addon.charts.util.SVGGenerator.getInstance( ~[vaadin-charts-4.2.0.jar:4.2.0]

I have tried downgrading the phantom JS version to 1.9.8. It is still getting issues.

Am I missing something in Linux environment to make it work?

Thanks in advance,

We got the solution by ourselves. We assumed it was the cause of Vaadin can’t initially setup and install phantomjs well at linux environment. Our solution is

  1. make symlink and manually install phantomjs which we already downloaded and extracted, at ubuntu environment according to below solution (Note: below question is for asking manual installing of phantomjs on linux).
  2. And then check sudo phantomjs -v . If it is show version no, your Java app will run smoothly.
  3. Otherwise it rised “phantomjs: error while loading shared libraries: cannot open shared object file: No such file or directory”, run below command to install too
    • sudo apt-get update
    • sudo apt-get install libfontconfig1