我试图通过Java Web Start应用程序打开SANE端口,当我通过本地Java应用程序运行此命令时,它工作正常,但是当我从Web Start应用程序运行它时它不起作用! / p>
这是我的代码:
public static void main(String[] args) {
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
try {
//Open SANE port
ProcessBuilder processBuilder = new ProcessBuilder(new String[] {"bash", "-c", "saned -d128"});
processBuilder.redirectErrorStream(true);
Process saneProcess = processBuilder.start();
BufferedReader in = new BufferedReader(new InputStreamReader(saneProcess.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) {
System.out.println(inputLine + "\n");
}
in.close();
}
}
catch (Exception e) {
e.printStackTrace();
}
return null;
}
});
}
这是我得到的输出:
[saned] main:启动调试模式(128级)
[saned] read_config:搜索配置文件
[saned] read_config:完成阅读配置 [saned] saned(AF-indep + IPv6)从后端1.0.24启动 [saned] do_bindings:试图获得服务端口&#34; sane-port&#34; (的getaddrinfo) [saned] do_bindings:[1] socket()使用IPv6
[saned] do_bindings:[1] setsockopt()
[saned] do_bindings:[1] bind()到端口6566
[saned] do_bindings:[1]绑定失败:权限被拒绝
[saned] do_bindings:[0] socket()使用IPv4 [saned] do_bindings:[0] setsockopt()
[saned] do_bindings:[0] bind()到端口6566
[saned] do_bindings:[0]绑定失败:权限被拒绝
[saned] do_bindings:无法绑定地址。离开。 [saned]致命错误;拯救,等待孩子...... [saned] bail_out:所有孩子都退出了