作者cruelrobot (哈哈哈)
看板PHP
标题[请益] PHP执行外部程式
时间Thu Feb 9 15:32:11 2012
之前在板上有提过问题,也受益良多,
但最近在进度上又遇到了些瓶颈,所以想再来请教一下板上的各位,
之前想将.sh档以PHP开启(exec、system),
前面两个背景程式都已成功开启,
但後来几个指令档却还是失败,
後来看了error log里,
发现以下的东西:
Could not find the main class: cgl.imr.samples.kmeans.KmeansDataGen. Program
will exit.
Exception in thread "main" java.lang.NoClassDefFoundError:
cgl/imr/client/PartitionFileCreator
Caused by: java.lang.ClassNotFoundException:
cgl.imr.client.PartitionFileCreator
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class: cgl.imr.client.PartitionFileCreator. Program
will exit.
但是我上次发现类似错误的时候,
我是因为linux的环境变数没有设好才导致的,
但是这一次改了似乎有没作用,
且因为我下的指令,单在cmd上是可以执行的,
但以php来跑这些指令时,却出现了这个问题,
最近de这些bug用的有些精力交瘁,
希望板上的各位能提供一些意见作参考。
小弟感激不尽~。
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.28.166.153
※ 编辑: cruelrobot 来自: 163.28.166.153 (02/09 15:34)