Compiling .as file to .swc

I'd like to compile a .as file to .swc so I can reference it directly, but I'm sure how to go about it in Flex.
I'm using the new Flash Builder 4 Beta, but have a working copy of Flex Builder 3 as well so either is fine.
Thanks,
David

I'm not to sure myself. I've been using eclipse too long to remember all the intracacies of command line stuff. I know the theory, but am out of practice. :-)
If you compile DatabaseConnectionBean on its own, I don't think it looks in the destination directory for supporting classes unless you tell it to:
something like this
javac -d ..\WEB-INF\classes\ -classpath ..\WEB-INF\classes\;%CLASSPATH% DatabaseConnectionBean.java
If I'm talking complete rubbish here, someone will kindly (or unkindly for that matter) correct me I am sure

Similar Messages

  • Solution for undefined Sym when compiling multiple files

    Hi, I'd like to suggest a solution for the common 'undefined sym' problem.
    Combining all the source files into one file solves the problem quite effectively.
    I'm not sure if this is due to gcc, or some name mangling scheme that's throwing
    the avm2 off but in any case, when I compile multiple c++ files 'separately', ie
    g++ (or gcc) A.c B.c C.c -O3 -DOSX -DRT_AS3 -swc -o library.swc
    results in
    1) undefined _main if main() is not in C.c (but in another file which is not last in the list),
    and
    2) calling ANY function in A.c or B.c from C.c results in an "undefined sym" runtime error.
    When combining the files into one unit however, and then compiling that unit works fine:
    on linux/darwin:
    cat A.c B.c C.c > unit.c
    g++ (or gcc) unit.c -O3 -DOSX -DRT_AS3 -swc -o library.swc
    hope this helps someone.
    J

    Perhaps I didn't explain my question well enough. We already are using a dependency management system (based on jam - blows the doors off of make). However, some of our libraries that we build consist of many ( 100+ ) individual .cpp files, and there are many of these libraries in a dependency hierarchy. Invoking the compiler once per file seems to be a source of considerable overhead. I want to invoke the compiler only twice per library, no matter how many individual .o files need to be rebuilt - once to rebuild the out of date subset of .c files (one "-c" style invocation, no link step, generate object files only), and once to link the rebuilt .o files and the unchanged .o files into the target shared object.
    However, the compiler will not accept multiple "-o" flags, forcing us to invoke it once per file if we want to specify an output name. I want an option (or a workaround) that will allow us to specify multiple source files, and the output name for each in one compiler invocation. One approach could be a flag that could be used repeatedly to specify source file name / object file name pairs on the command line. Another would be a flag that set a derivation rule by which the output object file name would be generated from the input source file name.
    Repeatedly invoking the entire toolchain to compile one file of many, when the include dependency graphs, symbol tables, template instantations, etc. of each of those files are certain to overlap to a great degree, seems to me like a huge waste. Why must we reparse std::basic_string for each source file if we know the build environment is the same, just because we want to specify the output filename?

  • VB6 source code cannot connect to Oracle database after compile to file.exe

    Hi All,
    I have a problem about VB6 connect with Oracle database. It can connect as normal when run on VB program. After compiled to file.exe and execute, it cannot connect to Oracle database. What's going on ? Please advise? Thank you.
    Here is sample of my code connection.
    Option Explicit
    Private wsData As New ADODB.Connection
    wsData.ConnectionString = _
    "Provider=MSDAORA.1;User ID=lsp;Password=lsp2007;Data Source=prd01;Persist Security Info=False"
    wsData.Open
    End sub
    Rgads,
    Ats.

    Hi,
    I believe you're in the wrong forum, this forum is for Oracle Application Express.

  • Error while compiling java file

    Hi, im newby in java,
    i was trying to compile java files, and after that i will use it in JSP as javabean.
    I have 2 files already, the first file is a connection code, and its compiled successfully, it looks like this
    i named this as ConnectionBean.java
    package my_package;
    import java.sql.*;
    public class ConnectionBean {
         private Connection con;
         private static final String driver = "org.postgresql.Driver";
         private static final String url = "jdbc:postgresql://localhost:5432/PSQLDS";
         private static final String username = "postgres";
         private static final String password = "mypassword";
         public ConnectionBean() {
         public Connection logOn() {
              try {
                   Class.forName(driver); con = DriverManager.getConnection(url, username, password); }
              catch(ClassNotFoundException e) {
                   System.err.println("ConnectionBean: driver unavailable..."); con = null; }
              catch (SQLException e) {
                   System.err.println("ConnectionBean: driver not loaded..."); con = null; }
              return con;
         public void logOff() {
              try {
                   con.close(); }
              catch (Exception e) {
                   e.printStackTrace(); }
    as you can see above im using "package", and yes i have manage to put all my java files within the correct path (ROOT\WEB-INF\classes\my_package)
    And also, i have test this class as javabean on JSP file and it works.
    There for i continue to create the second java file, as a purpose to create a back engine for JSP. I use the same package as ConnectionBean.java, it looks like this
    i named this as ListPageEngine.java
    package my_package;
    import java.beans.*;
    import java.sql.*;
    public class ListPageEngine {
         public static void main(String[] args) {
              ConnectionBean conBean = new ConnectionBean();}
    on compiling process using command "javac ListPageEngine.java", i get this error message
    ListPageEngine.java:11: cannot find symbol
    symbol : class ConnectionBean
    location: class my_package.ListPageEngine
    ConnectionBean conBean = new ConnectionBean();}
    ^
    ListPageEngine.java:11: cannot find symbol
    symbol : class ConnectionBean
    location: class my_package.ListPageEngine
    ConnectionBean conBean = new ConnectionBean();}
    ^
    2 errors
    I think, i am pretty much sure that all my configuration (wheater its Apache TomCat, Environment Variable or PostgreSQL server) was good, as a prove, i was able to use ConnectionBean.class in my JSP file.
    I susspect the problem is related with "package", seems i cannot use ConnectionBean class within ListPageEngine class when i use package.
    For another information, i didn't install such thing as J2EE, i only install JDK 1.5, i also guess this might be the cause.
    Right now im all stuck, i try to find thread which might be related with my problem but i failed to find it, most of them get the same answer by UncleSAM which are
    Try the following forum (about JSP technology)
    http://forum.java.sun.com/forum.jspa?forumID=45
    JavaBeans spec contains nothing about JSP, but JSP spec describes using of beans.
    i hope my question is clear so anyone who might have experience or clue with this problem might be able to help me.
    Thanks before

    finally folks, i found answer to my own problem hehehehe..
    the problem is on the compiling command (javac ... my_file.java), i found that i need to add some parameter on the command to make it works.
    This problem solved.

  • Error message when compiling book "file is corrupt" referring to a photo.  Or "cannot find original photo".  Can you use photos that have been "edited" out of "Book Mode"?

    Error message when compiling book "file is corrupt" referring to a photo.  Or "cannot find original photo".  Can you use photos that have been "edited" out of "Book Mode"?

    I did copy it to my desktop, but it still won't let me open it.  I think the file on the disc might be corrupt or something like that though the cd itself checks out fine as far as viruses go.  I was able to verify the disc, but that's about it.  My husband tried it on his iMac and we have the same issue.  It's unzipping the folder, but won't let us open the folder on both the Mac Book Pro or the iMac by double clicking, going to file/open or right clicking.  It just keeps saying the same message as I posted above.  I think I'm just going to have the client put the pictures on either a memory card or a USB memory stick so she won't have to compress the files for zipping purposes.  It's been too frustrating trying to open this folder on this cd she gave me.  She said she created/zipped the cd on her Mac Book Pro but it sure won't open on mine.

  • Problem in compiling j2me file

    Hello friends,
    friends my problem in compiling j2me file..
    when i compile my j2me file through WTK2.2 (toolkit)
    then it creates extra file including j2me" .class" file..
    for example if my j2me file is "aman.java" and when i compile it
    then it will covert into "aman.class" file but it creates one more file like "aman1$.class" ..plz help me to get out of this problem..coz its increase my j2me file size..
    thanks
    Aman

    That is an inner class in aman.java that you are seeing there.
    If you use inner anonymous classes, for example;
    public class MyMIDlet extends MIDlet {
       // code for the MIDlet
       // Anonymous inner class
       setCommandListener(new CommandListener() {
          public void commandAction(Command c, Displayable d) {
            // implementation;
            // may access MyMIDlet's private fields
    }then the command listener you create will become another class named MyMIDlet$1.class.
    In this example you can get rid of the inner class by making one of the existing classes implement that CommandListener interface:
    public class MyMIDlet extends MIDlet implmements CommandListener {
       public void commandAction(Command c, Displayable d) {
         // implementation;
         // may access MyMIDlet's private fields
       // code for the MIDlet
       // Instead of the anonymous inner class, we can now use MyMIDlet since it
       // implements CommandListener
       setCommandListener(this);
       // etc. etc. etc.
    }shmoove

  • Problem compiling java file to access web service! newbie troubles !

    I am new to web services and this is my first program...
    I am compiling java file which has import statement like:
    import org.apache.soap.util.xml.*;
    import org.apache.soap.*;
    import org.apache.soap.rpc.*;
    It says ----- package org.apache.soap.util.xml does not exist as one of errors..
    I have a folder that I named soap myself and I have activation.jar,serces.jar,mail.jar,soap.jar in it.
    I added c:\soap in my classpath and this was supposed to be the quickstart way to try an example out...
    but it gives me compilation errors... what should I do ?

    You'll need to specify each jar file in the classpath. c:\soap\xerces.jar;c:\soap\sax.jar;....

  • Problem while compiling 'dll' files in Form Server..Urgent

    Hi!
    I'm trying to compile the library(dll) in form server and getting a message that "can not open that file".At the same time able to compile 'fmb' files which is in the same directory.
    Could you please help me?
    Thank you,
    Denish

    I am also working on Forte. Forte has an inbuilt Tomcat. You dont need to copy any files to any where in the file mount system. You need to specify the External / Internal Browser settings, So that when you try to execute it, the .jsp file can be displayed in the browser. I havent faced any problem as you said.
    Uma
    http://www.javagalaxy.com

  • Problem compiling source file in package

    Hi, I have 5 source files which I have just packaged together and put in the same sub-directory, the problem is that when I try to compile the file with the main method I get the error message:"cannot read" then the name of the source file. I am compiling from the command line and setting the classpath as I compile with the statement:
    c:\j2sdk1.4.1\bin>javac -classpath c:\directory\package directory source file.java
    I'm not sure what I am doing wrong and the source files all compiled fine before I added the package statement to the files. Please any help would really be appreciated.

    It sounds like the java file your are trying to compile is not in the directory you are compiling from.
    Is this basically what you are doing?:
    Say the package name is mypackage.
    Assume we are O.K. with keeping source and class files together.
    Create a directory named 'mypackage' somewhere...C:\mypackage\.
    Put all the .java files in it (these .java files indicate that they are a member of the 'mypackage' package).
    At a command prompt, cd to the directory containing the 'mypackage' directory...'cd C:\'
    Compile the source files: C:\j2sdk1.4.1\bin\javac mypackage\*.java
    run the main class: C:\j2sdk1.4.1\bin\java mypackage.TheMainClass
    Basically, this says keep the files where you want them and point to javac, instead of moving everything under java/bin. btw it will save a lot of typing if you add java/bin to your PATH.
    Hope this helps.

  • How to check the JDK version of a compiled java file

    can anybody tell me how to check the JDK version of a compiled java file ?
    Edited by: gbhatia8 on Sep 9, 2010 7:04 AM

    The major/minor version of the class file is the way to go.
    Also, it's not necessary to write a separate program to get to those. javap prints them out when being passed the -v flag.
    Note, however that "JDK version" is not a correct term, as I can create 1.4-compatible class files with a Java 6 JDK (by passing the -target flag to javac). Those won't look any different than .class files written with a 1.4 JDK.

  • How to compile Java files using Ant in Eclipse

    Hi All ,
    I would like to compile all Java files using Ant in Eclipse.Since am very new to Ant and Eclipse can someone help me to create a build.xml file and let me know how to compile all the java files.
    For ex , I have placed my java files inside the path C:\HEC\Terab.Initially the Terab folder holds 7 jar files which i had decompiled using JD compiler and placed the unzipped 7 folders (which contains the java files ).Now i have imported the HEC project into Eclipse using New ->Project ->Java Project.after importig it throwed me an error saying missing jar files.again i copied the jar files and placed inside Terab folder with other 7 folder.
    Now How i can compile the java files and convert in to class files.Then after compiling the files i will again need to jar all the 7 folder.
    Please tell me the steps i need to follow.How to write an build.xml file ? where i should keep it ? only one build.xml file is enough or should i write 7 build.xml file for each folder ? Please help me out...
    Thanks & Regards
    Kar1983

    put it another way, what I am trying to do is to compile David Brackeen's ch 18 code from his book. The java sourse files can be downloaded here:
    http://www.brackeen.com/javagamebook/
    my question is that how would I complie all of these file so that I can get the program in ch18src\src\com\brackeen\javagamebook\test\ to run?

  • Java application compiles java files in memory

    how can I use java application program (that may call method runtime exec or some other techniques) to compile the other java files that were already loaded in memory. (I can not copy those target files to the hard disk with extension java, then compile for security reason).

    And once they are compiled, where do you plan to put the compiled .class files? Same security problem, right? Perhaps you planned to load and use them "from memory" somehow? This would be a different security problem. Perhaps you need to rethink what you are doing.

  • Compiling java files in DOS window

    Hi,
    I have been writin a small Client Server Application. I am attempting to use java packages in order to put certain class files into particular directories, and then import the packages when needed.
    So far, i have started my 1st attempt at a very small application just to send / receive messages. My problem is however, that i can compile all the java files into specific directories & packages no problem, but when i try to compile the java files which make use of these classes, i keep getting the same error.
    OK, i will try to simplify,
    My Server program (called MyServer.java) uses 2 classes (called ProcessTransaction, and NumberValidator), I have compiled the generated class files from ProcessTransaction.java and NumberValidator.java files into a DIR called C:\JavaForm\serverstuff. i.e. my server program imports the package "serverstuff,*;" The problem is that when i try to compile my server program i get the error message:
    "cannot access ProcessTransaction
    bad class file: c:\JavaForm\ProcessTransaction.java
    file does not contain class ProcessTransaction
    Please remove or make sure it appears in the correct subdirectory of classpath"
    I am using the command:
    javac -classpath c:\JavaForm c:\JavaForm\MyServer.java to compile the server file
    All the java and class files are stored in the C:\JavaForm folder
    I dont understand why the ProcessTransaction call cannot be accessed because it is most definitely in the compiled java file!!!
    Any help would be much appreciated!!!
    Cheers
    Iain

    it's OK, i figured out that to compile the Server program successfully, you have to remove all the other java files from the DIR which the Server.java files exists, or else there is a conflict!!!! I dont know why, but that's what you have to do!!!!

  • Location of compiled java files

    Where are the compiled java files for jsps? Sometimes I get jsp errors in the log
    files like:
    D:\jsrv\my\WEB-INF\_tmp_war_myserver_myserver_my\jsp_servlet\_mypage\_cancelmembership.java:105:
    ')' expected
    However, the _cancelmembership.java file does not exist at that location. Only
    the _cancelmembership.class file exists at that location.

    You do NOT want to change the bundled CSS files. Create your own CSS and include it in the template after the built-in CSS include. Any classes you create in your own file of the same name and specificity as the built-in classes will override those classes. For example:<style type="text/css">
    td.myclass{color:red}
    td.myclass{color:blue}
    </style>The color of the text in a table cell with the class "myclass" will be blue, not red, since the same class was defined twice, it will use the one that came last on the page.
    If you change the classes in the built-in template CSS files, you'll change them for everyone using your APEX instance, which is not a particularly good thing to do.
    Tyler

  • Problem compiling a  file which utilises a class I've created

    I am experimenting with creating my own classes. I've created my own class and I'm able to compile it. When I try to compile my test file to test the class I get a "cannot resolve symbol" error referring to where my class name is in the test file. The thing is, I've emailed the files to a friend and he is able to compile both files and subsequently run the test file. Has anyone got any ideas as to why my friend can compile the test file but I cannot?

    My XP machine is at home, so I cannot verify that. But for W2K, you can right-click on the My Computer icon, select Property. Then select Advanced tab. In the middle is Environment Variables. Click on the button to open up the User Variables and System variables. CLASSPATH is in the System Variables pane.
    XP should be similar to W2K. Give it a try.
    Hope this helps.

Maybe you are looking for