blob: 85e56480631279a3d41ed54e20c0b461e5ad6945 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta name="DC.Type" content="topic"/>
<meta name="DC.Title" content="SDK configuration"/>
<meta name="DC.Format" content="XHTML"/>
<meta name="DC.Identifier" content="WS2db454920e96a9e51e63e3d11c0bf69084-7fd9_verapache"/>
<title>SDK configuration</title>
</head>
<body id="WS2db454920e96a9e51e63e3d11c0bf69084-7fd9_verapache"><a name="WS2db454920e96a9e51e63e3d11c0bf69084-7fd9_verapache"><!-- --></a>
<div>
<p>Use the configuration files included with the Flex SDK
to configure the compilers and other aspects of Flex.</p>
</div>
<div class="nested1" id="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff9_verapache"><a name="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff9_verapache"><!-- --></a>
<h2 class="topictitle2">About configuration files</h2>
<div class="nested2" id="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff7_verapache"><a name="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff7_verapache"><!-- --></a>
<h3 class="topictitle3">Root variables</h3>
<div>
<p>For Flex SDK, the <em>flex_install_dir</em> variable is the
top-level directory where you installed the SDK. Under this directory
are the bin, frameworks, lib, and samples directories. The <em>flex_app_root</em> directory
is the top level location for many files. </p>
</div>
</div>
<div class="nested2" id="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff6_verapache"><a name="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff6_verapache"><!-- --></a>
<h3 class="topictitle3">Configuration files layout</h3>
<div>
<p>The
layout of the configuration files for Flex SDK is simple. It includes
a jvm.config file, fdb command-line debugger shell script, and the
mxmlc and compc command-line compiler shell scripts for configuring
the JVM that the compiler uses. It also includes the flex-config.xml
file that sets the compiler options, as well as executable files
for fdb, mxmlc, and compc.</p>
<p>The layout of the configuration files for Flex SDK is as follows:</p>
<pre class="codeblock"><em>sdk_install_dir/ </em>
  bin/jvm.config
  bin/mxmlc
  bin/mxmlc.exe
  bin/compc
  bin/compc.exe
  bin/fdb
  bin/fdb.exe
  frameworks/flex-config.xml</pre>
</div>
</div>
</div>
<div class="nested1" id="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff5_verapache"><a name="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff5_verapache"><!-- --></a>
<h2 class="topictitle2">Flex SDK configuration</h2>
<div>
<p>Flex SDK includes the mxmlc and compc command-line compilers.
You use mxmlc to compile applications from MXML, ActionScript, and
other source files. You use the compc compiler to compile component
libraries, Runtime Shared Libraries (RSLs), and theme files.</p>
<p>The compilers are located in the <em>sdk_install_dir</em>/bin directory.
You can configure the compiler options with the flex-config.xml
file or command line options.</p>
<div class="p">The compilers use the Java JRE. As a result, you can also configure
settings such as memory allocation and source path with the JVM
arguments.<div class="note"><span class="notetitle">Note:</span> You must use a 32-bit version of the JDK, version
1.5 or later. The command line compilers do not work with a 64-bit
JDK.</div>
</div>
</div>
<div class="nested2" id="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff4_verapache"><a name="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff4_verapache"><!-- --></a>
<h3 class="topictitle3">Command-line compiler configuration</h3>
<div>
<p>The
flex-config.xml file defines the default compiler options for the
compc and mxmlc command-line compilers. You can use this file to
set options such as debugging, SWF file metadata, and themes to
apply to your application. For a complete list of compiler options,
see <a href="flx_compilers_cpl.html#WS2db454920e96a9e51e63e3d11c0bf69084-7fcc_verapache">Using
mxmlc, the application compiler</a> and <a href="flx_compilers_cpl.html#WS2db454920e96a9e51e63e3d11c0bf69084-7fd2_verapache">Using
compc, the component compiler</a>.</p>
<p>The flex-config.xml file is located in the <em>sdk_install_dir</em>/frameworks
directory. If you change the location of this file relative to the
location of the command-line compilers, you can use the <samp class="codeph">load-config</samp> compiler
option to point to its new location.</p>
<p>You can also use a local configuration file that overrides the
compiler options of the flex-config.xml file. You give this local
configuration file the same name as the MXML file, plus "-config.xml"
and store it in the same directory. For example, MyApp-config.xml.
When you compile your MXML file, the compiler looks for a local
configuration file first, then the flex-config.xml file.</p>
<p>For more information on compiler configuration files, see <a href="flx_compilers_cpl.html#WS2db454920e96a9e51e63e3d11c0bf69084-7fca_verapache">About
configuration files</a>.</p>
</div>
</div>
<div class="nested2" id="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff3_verapache"><a name="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff3_verapache"><!-- --></a>
<h3 class="topictitle3">JVM configuration</h3>
<div>
<p>The
Flex compilers use the Java JRE. Configuring the JVM can result
in faster and more efficient compilations. Without a JVM, you cannot
use the mxmlc and compc command-line compilers. You can configure
JVM settings such as the Java source path, Java library path, and
memory settings.</p>
<div class="p">You must use JDK 1.5 or later with the command-line compilers.
These compilers are 32-bit executables and cannot launch 64-bit
processes. As a result, they require a 32-bit version of Java to
run. If you have both a 32-bit and 64-bit JDK installed, you can
use several techniques to target the 32-bit version for compilation,
including:<ul>
<li>
<p>Using the <samp class="codeph">JAVA_HOME</samp> environment
variable to point to the 32-bit version of the JDK when you compile
with mxmlc or compc</p>
</li>
<li>
<p>Modifying the Flex SDK's jvm.config file to point to the
32-bit version of the JDK</p>
</li>
<li>
<p>Using batch files that point to the 32-bit version of the
JDK to launch the compilers</p>
</li>
</ul>
</div>
<p>On Windows, you use the compc.exe and mxmlc.exe executable files
in the bin directory to compile Flex applications and component
libraries. You use the fdb.exe executable file in the bin directory
to debug applications. The executable files use the jvm.config file
to set JVM arguments. The jvm.config file is in the same directory
as the executable files. If you move it or the executable files
to another directory, they use their default settings and not the
settings defined in the jvm.config file.</p>
<p>The fdb, compc,
and mxmlc shell scripts (for UNIX, Linux, or Windows systems running
a UNIX-shell emulator such as Cygwin) do not take a configuration
file. You set the JVM arguments inside the shell script file.</p>
<p>The jvm.config file is used by the Java process opened by the
mxmlc and compc command-line executable files. The file is located
in <em>sdk_install_dir</em>/bin. </p>
<div class="section" id="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff3_verapache__WS2db454920e96a9e51e63e3d11c0bf5fb32-8000_verapache"><a name="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff3_verapache__WS2db454920e96a9e51e63e3d11c0bf5fb32-8000_verapache"><!-- --></a><h4 class="sectiontitle">Changing
the JVM heap size</h4>
<p>The most common JVM configuration is to set
the size of the Java heap. The Java heap is the amount of memory
reserved for the JVM. The actual size of the heap during run time
varies as classes are loaded and unloaded. If the heap requires more
memory than the maximum amount allocated, performance will suffer
as the JVM performs garbage collection to maintain enough free memory
for the applications to run. </p>
<p>You can set the initial heap
size (or minimum) and the maximum heap size on most JVMs. By providing
a larger heap size, you give the JVM more memory with which to defer
garbage collection. However, you must not assign all of the system's
memory to the Java heap so that other processes can run optimally.</p>
<p>To
set the initial heap size on the Sun HotSpot JVM, change the value
of the <samp class="codeph">Xms</samp> property. To change the maximum heap
size, change the value of the <samp class="codeph">Xmx</samp> property. The
following example sets the initial heap size to 256M and the maximum
heap size to 512M:</p>
<pre class="codeblock"> java.args=-Xms256m -Xmx512m -Dsun.io.useCanonCaches=false</pre>
<p>In
addition to increasing your JVM's heap size, you can tune the JVM
in other ways. Some JVMs provide more granular control over garbage
collecting, threading, and logging. For more information, consult
your JVM documentation or view the options on the command line.
If you are using the Sun HotSpot JVM, for example, you can enter <samp class="codeph">java -X</samp> or <samp class="codeph">java -D</samp> on
the command line to see a list of configuration options.</p>
<p>In
many cases, you can also use a different JVM. Benchmark your Flex
application and the application server on several different JVMs.
Choose the JVM that provides you with the best performance.</p>
<p>Setting
the <samp class="codeph">useCanonCaches</samp> argument to <samp class="codeph">false</samp> is
required to support Windows file names.</p>
</div>
</div>
</div>
</div>
<div class="nested1" id="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff2_verapache"><a name="WS2db454920e96a9e51e63e3d11c0bf5fb32-7ff2_verapache"><!-- --></a>
<h2 class="topictitle2">Flash Player configuration</h2>
<div>
<p>You
can use the standard version or the debugger version of Adobe<sup>®</sup> Flash<sup>®</sup> Player
as clients for your Flex applications. The debugger version of Flash
Player can log output from the <samp class="codeph">trace()</samp> global method
as well as data services messages and custom log events.</p>
<p>You enable and disable logging and configure
the location of the output file in the mm.cfg file. For more information
on locating and editing the mm.cfg file, see <a href="flx_logging_lg.html#WS2db454920e96a9e51e63e3d11c0bf69084-7fc9_verapache">Editing
the mm.cfg file</a>.</p>
<p>You can configure the standard version and the debugger version
of Flash Player to use auto-update and other settings by using the
mms.cfg file. This file is in the same directory as the mm.cfg file.
For more information on auto-update, see the Flash Player documentation.</p>
<p/>
</div>
<div>
<p><strong>Navigation</strong></p>
<p><a href="index.html">Using Flex</a> &raquo; <a href="flx_p1_gettingstarted.html">Getting Started</a></p>
</div>
<p>Adobe and Adobe Flash Player are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries and are used by permission from Adobe. No other license to the Adobe trademarks are granted.</p>
</div>
</body>
</html>