Linux 下 phantomjs异常:Can not run program “phantomjs“: CreateProcess error=2, 系统找不到指定的文件

java.io.IOException: Cannot run program "phantomjs": error=2, No such file or directory
        at java.base/java.lang.ProcessBuilder.start(Unknown Source) ~[na:na]
        at java.base/java.lang.ProcessBuilder.start(Unknown Source) ~[na:na]
        at java.base/java.lang.Runtime.exec(Unknown Source) ~[na:na]
        at java.base/java.lang.Runtime.exec(Unknown Source) ~[na:na]
        at java.base/java.lang.Runtime.exec(Unknown Source) ~[na:na]
        at com.futuremind.fm.utils.EchartsUtil.generateBarImage(EchartsUtil.java:66) ~[classes!/:1.0.1]
        at com.futuremind.fm.service.impl.QuestionnaireRecordService.exportEvaluationPDF(QuestionnaireRecordService.java:1364) ~[classes!/:1.0.1]
        at com.futuremind.fm.service.impl.QuestionnaireRecordService$$FastClassBySpringCGLIB$$1a51b9db.invoke(<generated>) ~[classes!/:1.0.1]
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) ~[spring-core-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
        at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:685) ~[spring-aop-5.0.5.RELEASE.jar!/:5.0.5.RELEASE]
        at com.futuremind.fm.service.impl.QuestionnaireRecordService$$EnhancerBySpringCGLIB$$f9ce6422.exportEvaluationPDF(<generated>) ~[classes!/:1.0.1]
        at com.futuremind.fm.service.impl.EvaluationScoringRulesService.lambda$caculationEvaluationGroupScore$1(EvaluationScoringRulesService.java:182) ~[classes!/:1.0.1]
        at java.base/java.lang.Thread.run(Unknown Source) ~[na:na]
Caused by: java.io.IOException: error=2, No such file or directory
        at java.base/java.lang.ProcessImpl.forkAndExec(Native Method) ~[na:na]
        at java.base/java.lang.ProcessImpl.<init>(Unknown Source) ~[na:na]
        at java.base/java.lang.ProcessImpl.start(Unknown Source) ~[na:na]
        ... 13 common frames omitted

首先检测环境变量是否配置完好

phantomjs-2.1.1-linux-x86_64 根据环境配置phantomjs 的环境变量即可

就可以了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值