【问题标题】:Error #3219 NativeProcess in AIRAIR 中的错​​误 #3219 NativeProcess
【发布时间】:2011-05-26 13:02:05
【问题描述】:

我有一个适用于 Windows 和 Mac Os 平台的 AIR 2.6 程序。使用 NativeProcess 类来执行我在项目中包含的本机应用程序。

在 Windows 中一切正常,但在 Mac 中无法正常工作。

代码是:

var executable:File = File.applicationDirectory.resolvePath('bin/mac/convert') 
var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = executable;
nativeProcessStartupInfo.arguments = params;
nativeProcessStartupInfo.workingDirectory = workingDirectory;

if(NativeProcess.isSupported)
    start(nativeProcessStartupInfo);

错误在 start(...) 行:

Error #3219: The NativeProcess could not be started. 'launch path not accesible'.

Executable var 是路径在 debug=/Users/awakening/Documents/workspace/flashbuilder/SDTDV/bin-debug/bin/mac/convert 中的文件

它说存在=真。发布版本也有同样的问题。

提前谢谢你。

【问题讨论】:

    标签: apache-flex macos actionscript air native


    【解决方案1】:

    如果您尝试执行的文件没有设置执行位,您将收到此错误。

    您可以在命令行中使用chmod

    或者,如果使用 Flex/Flash Builder,您可以右键单击文件并选择属性。然后设置执行位

    【讨论】:

    • 你设置了所有行的执行位吗?
    • 其他行仅用于多用户系统(例如 Unix/Linux 服务器)。假设您是系统上唯一正在开发应用程序的用户,只需将其设置为 Owner
    【解决方案2】:

    你的意思是jar文件吗?要运行 JAR 文件,我认为您需要使 JAVA 成为可执行文件并将 jar 文件的参数传递给它。

    【讨论】:

    • 顺便说一句,我认为您也可以调用 /usr/bin/open 并将 JAR 文件作为参数传递。它使用与 Mac 的“Finder”应用程序相同的过程。
    • 它不是一个 jar 文件。它是一个命令行程序。在 AIR 中,您指示可执行文件(/Users/awakening/Documents/workspace/flashbuilder/SDTDV/bin-debug/bin/mac/convert)及其参数。
    • 好的,您是否尝试使用 /Users/awakening/Documents/workspace/flashbuilder/SDTDV/bin-debug/bin/mac/convert 作为参数运行 /usr/bin/open,然后是它的论据?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-10-08
    相关资源
    最近更新 更多