我如何建立一个FLEX_HOME环境变量在Flash Builder [英] How do I set up a FLEX_HOME environment variable in Flash Builder

查看:648
本文介绍了我如何建立一个FLEX_HOME环境变量在Flash Builder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行在Flash Builder错误Ant构建脚本会生成。所以我把出口FLEX_HOME = /应用/使用Adobe \\闪光\\生成器\\ 4.7 /软件开发工具包/ 4.6.0 / 在我的 .zshrc 。这在命令行罚款,但在FB没有。

的build.xml

 <?XML版本=1.0&GT?;
<项目名称=HelloWorld的BASEDIR =../默认值=编译>
    <! - 设置preFIX所有的环境变量 - >
    <物业环境=ENV/>
    <失败,除非=env.FLEX_HOME消息=FLEX_HOME需要被定义为环境变量或在Ant构建。 />
    <! - 加载用户属性overrride默认设置 - >
    <属性文件=$ {} BASEDIR /build/build.properties/>
    <! - 系统环境中必须包含FLEX_HOME变量指向的Flex SDK - >
    <属性名=FLEX_HOME位置=$ {} env.FLEX_HOME/>
    <! - 设置Flex的任务蚂蚁 - >
    <的taskdef资源=flexTasks.tasks的classpath =$ {} FLEX_HOME /ant/lib/flexTasks.jar/>    <! - 创建所需的构建过程目录 - >
    <目标名称=初始化描述=初始化项目和目标文件夹。>
        <回声消息=项目:$ {} ant.project.name/>
        <回声消息=的Flex SDK:$ {} FLEX_HOME/>
        <回声消息=Flex的家是$ {} env.FLEX_HOME/>
        <删除DIR =$ {} bin.dir/>
        < MKDIR DIR =$ {} bin.dir/>
    < /目标与GT;    <目标名称=编译取决于=初始化描述=编译应用程序。>
        < mxmlc的文件=$ {对于src.dir} / $ {} application.name。至于输出=$ {bin.dir} / $ {} application.name的.swf>
            <负载配置文件名=$ {} FLEX_HOME /frameworks/flex-config.xml/>            <信源路径路径元素=$ {}对于src.dir/>        < / mxmlc的>
        <回声消息=的$ {} application.name瑞士法郎已经$ {} bin.dir创建/>
    < /目标与GT;< /项目>

和错误

 构建文件:/用户/ gadzimari /文档/使用Adobe Flash Builder的4.7 /的HelloWorld /建设/ build.xml文件构建失败
/用户/ gadzimari /文档/使用Adobe Flash Builder的4.7 /的HelloWorld /编译/ build.xml文件:5:FLEX_HOME需要被定义为环境变量或在Ant构建。总时间:302毫秒


解决方案

您需要同样设置FLEX_HOME你如何设置JAVA_HOME。

转到您的用户/ {用户名}文件夹,找到你的的.bash_profile。如果没有bash的配置文件存在那里,使空单为.txt文件,保存它,然后从.bash_profile.txt到.bash_profile文件。

重命名

然后将以下添加到您的bash配置文件:

 出口FLEX_HOME = / {弯曲安装路径}

替换实际弯曲括号内的部分安装路径为您的系统,然后保存。为了验证它,打开一个新的命令行并使用命令回声$ FLEX_HOME。如果使用/响应{弯曲安装路径},那么它是否设置正确。

When I try to run Ant build script in Flash Builder error will generate. So I put export FLEX_HOME=/Applications/Adobe\ Flash\ Builder\ 4.7/sdks/4.6.0/ in my .zshrc. This works fine in command line, but doesn't in FB.

build.xml

<?xml version="1.0"?>
<project name="helloworld" basedir="../" default="compile">
    <!-- Set up prefix for all environment variables -->
    <property environment="env" />
    <fail unless="env.FLEX_HOME" message="FLEX_HOME needs to be defined as an environment variable or in the Ant build." />
    <!-- Load user properties to overrride defaults -->
    <property file="${basedir}/build/build.properties" />
    <!-- System environment must contain FLEX_HOME variable that points to Flex SDK -->
    <property name="FLEX_HOME" location="${env.FLEX_HOME}" />
    <!-- Set up Flex tasks in Ant -->
    <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />

    <!-- Create directories needed for the build process -->
    <target name="init" description="Initializes project and destination folders.">
        <echo message="Project: ${ant.project.name}" />
        <echo message="Flex SDK: ${FLEX_HOME}" />
        <echo message="Flex home is ${env.FLEX_HOME}" />
        <delete dir="${bin.dir}" />
        <mkdir dir="${bin.dir}" />
    </target>

    <target name="compile" depends="init" description="Compiles the application.">
        <mxmlc file="${src.dir}/${application.name}.as" output="${bin.dir}/${application.name}.swf">
            <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />

            <source-path path-element="${src.dir}" />

        </mxmlc>    
        <echo message="The ${application.name}.swf has been created in ${bin.dir}" />
    </target>

</project>

And the error

Buildfile: /Users/gadzimari/Documents/Adobe Flash Builder 4.7/helloworld/build/build.xml

BUILD FAILED
/Users/gadzimari/Documents/Adobe Flash Builder 4.7/helloworld/build/build.xml:5: FLEX_HOME needs to be defined as an environment variable or in the Ant build.

Total time: 302 milliseconds

解决方案

You need to set your FLEX_HOME similarly to how you set JAVA_HOME.

Go to your Users/{username} folder and find your ".bash_profile". If no bash profile exists there, make an empty one as a .txt file, save it, and then rename it from ".bash_profile.txt" to ".bash_profile".

Then add the following to your bash profile:

export FLEX_HOME=/{flex install path}

Replace the bracketed portion with the actual flex install path for your system, then save. To verify it, open a new command line and use the command "echo $FLEX_HOME". If it responds with /{flex install path}, then it is set properly.

这篇关于我如何建立一个FLEX_HOME环境变量在Flash Builder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆