Compiling all possible java files

Hi,
I have a project in which not all files/packages compiles but a set of packages compiles always.
Say set of classes which might not compile as 'A' and set of classes which will always compile as 'B'
On frequent basis i need to get update. And I am only concerned about set 'B' but when i compiles my project using ant
compilation fails as 'A' compilation fails and because of that it doesn't go further to compile 'B'.
So how to get eclipse like functionality to compile all possible files?
what i have is
================================
<javac debug="${debug}" deprecation="${deprication}"
               optimize="${optimize}" destdir="${build.home}/WEB-INF/classes"
               listfiles="${listfiles}" target="${jdk.compliance}"
               verbose="${verbose}" srcdir="${src.home}"
               memoryMaximumSize="512M" fork="true"
               source="${src.compliance}">
               <classpath refid="compile.path"/>
               <include name="**/*.java"/>
               <exclude name="HBM/**"/>
               <compilerarg value="-Xlint:unchecked"/>
===================================
I do not wish to write all the classes specifically that compiles in ant script.
Thanks in Advance

Try with failonerror option in your javac.
        <javac debug="${debug}" deprecation="${deprication}" optimize="${optimize}" destdir="${build.home}/WEB-INF/classes" listfiles="${listfiles}" target="${jdk.compliance}" verbose="${verbose}" srcdir="${src.home}" memoryMaximumSize="512M" fork="true" source="${src.compliance}" {color:#0000ff}*failonerror="false"*{color}>
            <classpath refid="compile.path" />
            <include name="*/.java" />
            <exclude name="HBM/**" />
            <compilerarg value="-Xlint:unchecked" />Regards,
Prashanth.

Similar Messages

  • How to compile dunamically genrated java files through java program?

    Hi, I have a requirement where i generate java files from WSDL dynamically using wsdl2java jaxbri. I need to compile these files dynamically on the fly and jar it. Everything should happen through java program. Bcos everything is dynamic here, no information is known (like dir, file names ...) until the runtime. Everything is user fed.
    the directories may contain other directories with java files. its recursive
    i tried com.sun.tools.javac.Main.. but either its not scaling to my needs or i donno how to wok with this.
    is there any option to compile the java files as they are created thru JAXBRI (wsdl2java)?
    any help is appreciated..
    -s

    my requirement is :
    i create java files from wsdl2java (axis).. i need to compile all the java files.. directories with in the directories (recursive)...
    as bcos the the java files have inter-dependencies they have to be compiled as a bunch something like (java *.java). I donno how to do this in javac.Main tool
    Once all these files are compiled i need to create a jar out of them
    Any help is appreciated!

  • How to compile and run java files on a mac using command line?

    can someone tell me or link me to some article on how to compile and run java files from command line on a mac? I have mac OS X leopard

    What do you mean by "where to put them" ? What do you want to put anywhere ?
    Have you read Peter's comment in brackets ? Perhaps you have a classpath problem ?
    Edited by: Michael_Knight on Aug 31, 2008 4:23 AM

  • Is it possible to compile & run other java files from one file

    hi friends,
    i need to run 2,3 java sourse files(first.java,second.java etc) from one file.i tried the Runtime.getRunTime().exec( cmd) but here cmd must be a executable file
    what is need is to compile and run the files (first.java,second.java) from one other source file
    pls. help me in this matter,
    with warm regards,
    Vishal

    Sure:public class Test {
       public static void main(String[] args) {
          try {
             Runtime r = Runtime.getRuntime();
             r.exec("javac Test2.java");
          } catch (Exception e) {
    public class Test2 {
       public static void main(String[] args) {
          System.out.println("Hello World!");
    }Note that Test and Test2 are in two seperate files.

  • Compiling / Running a Java file in JSP

    Hi,
    ok, I have a jsp page, which we will call page 1. Once I go to that page, I all I want it to do is compile a certain file.java, and then run the file.java. The user doesn't actually know that this is going on in the background. Page 1 automatically redirects the user to page 2 (also a jsp page).
    The java program that I created (that was previously compiled and ran) creates a special javascript file. After running the file.java in page #1, the java file creates a javascript file that will be used in page 2 to display a tree node (group of information).
    so, right now, I'm trying to figure out how to write the jsp code that will tell how to compile and run a java file. I was thinking about using javabeans before, but I think you HAVE to actually display the contents of the java file into the jsp (I think). Anyhow, thanks for the help!

    sorry about being ambiguous before. What I mean by
    running a java file was that I already created a java
    file. I don't want to hava my java statements inside
    the jsp file. I just want the jsp file have a command
    in it that would call a java file, tell the java file
    to compile and run. All the jsp file would do
    (hopefully) is just give commands for a seperate java
    file to compile and run. Thanks again for any help!Ok, so this other java file has some entry-point method, like main(), right? So call it...
    <%
    YourJavaClass.main(appropriateArgumentsGoHere);
    %>
    or better yet, it's an object you can use:
    <%
    YourJavaClass x = new YourJavaClass();
    x.callSomeMethodHere(withAppropriateArgumentsHere);
    x.callAnotherMethodMaybe();
    %>
    You don't need the jsp file to "compile" this java file, you'd already have compiled it beforehand, and it's class bytecode needs to be in your classpath (on the server side) of course.

  • Where do I find all the Java files?

    First, let me say that I know very little about Java. I updated to "Java for Mac OSX 10.4 Release 6" using Software Update. The size of the Java update file is supposed to be 80.7 MB. Although I cannot identify any possible Java related problems, other than slow loading of some web pages, I am curious as to where Java related files of anywhere near this size are located on my computer. All I see is a Java application file of 1.6 MB, which is actually smaller than before the update (3.2 MB Rel 5), and a few KBs in user>caches>java and system>library. The file dates are all correct for the update and the receipt file is present. How can I be sure that I got all of the update and where are all the Megabytes? Thanks in advance for any help. RG.

    The files are scattered through the system.
    e.g. /System/Library/Java
    /System/Library/Frameworks/Java* (whole bunch of sub-folders here)
    /System/Library/PrivateFrameworks/Java* (ditto)
    and a bunch more in the hidden folders under /usr, for example.
    Not sure if this requires Developer Tools, but in Terminal:
    lsbom /Library/Receipts/JavaForMacOSX10.4Release6.pkg/Contents/Archive.bom
    will give a list of all the files installed/updated by the package.
    - cfr

  • Error in compilation satge of java files

    Hi all
    Whenever i m trying to compile java files i m getting this error .I have no idea how to go about fixing this issue. Can any one help me out with this.
    Error occurred during initialization of VM
    Could not reserve enough space for object heap

    Well i could go ahead and solve the issue by bringing down the memory allocation at the minimum and maximum level during the compilation stage.
    I got the tip from the forum itself where a similar problem had been reported and there this tip was provided.
    Earlier in my case i was allocating 1GB of memory for compilation but due to some issue that much space was not being detected on the server. When i pruned that down to 512mb the compilation went ahead without any trouble.
    Thanks kelly for geting in involved in geting to know the issue .

  • Where are all the .java files????

    I placed a few of Oracle's demo JAR and fmb/fmx files on my server to test a couple of things, and they are working fine. (I moved them over to the server by copying the JAR file off my local machine and pasting then into the forms90/java folder on my server. Then I copy and pasted the fmx and fmb files over and created a [this_demo] profile for each one I was using. I also added the .jar to the formsweb.cfg)
    Anyways.....
    I would like to look at the actual code for one of these demos, but can't find the .java file anywhere. It's not in the JAR file. All that is in the JAR file is META-INF and oracle/forms/demos/enhancedItems2/.class(es) files.
    I also downloaded sun's juggling duke JAR file(s) -juggler.jar and methodtracer.jar. I created a test form and got Duke to juggle just fine, but I would like to take a look at the .java code. Where should that be???
    Thanks in advance

    An error occured when trying to open the file for reading. Filename: ".\jad\tmp\MOLine.java"
    Current Working Directory: C:\Program Files\Cavaj Java Decompiler\
    System error message: The system cannot find the file specified.
    C++ exception: ios: failbit setDo you get the same error if you use a directory name which has no space in name?
    Question is, when I am trying to decompile MOLine.class to produce MOLine.java, why is it looking for MOLine.java?Most probably because you cannot decompile the class file (I believe if it was possible, Oracle would have provided the java file).
    Thanks,
    Hussein

  • Error: code too large for try statement, when compiling a big java file.

    Hi,
    I have a big java file ( around 16000 lines). When compiling it, I got following error message:
    MyMain.java:15233: code too large for try statement
    } catch ( Throwable t ) {
    In MyMain.java, I just repeat following statements about 1000 times.
    try {
    if ( year >= 2002 ) {
    System.out.println( "year: Evaluation version is not valid" );
    } else {
    System.out.println( "year: Evaluation version is still valid" );
    } catch ( Throwable t ) {
    if ( year >= 2002 ) {
    System.out.println( "year: Evaluation version is not valid" );
    } else {
    System.out.println( "year: Evaluation version is still valid" );
    I tried 1.3 and 1.4 javac compiler, there was some error.
    How to make compiler to compile this code?
    Thanks,

    Hi,
    I have a big java file ( around 16000 lines). When
    compiling it, I got following error message:
    MyMain.java:15233: code too large for try statement
    } catch ( Throwable t ) {
    I tried 1.3 and 1.4 javac compiler, there was some
    error.
    How to make compiler to compile this code?
    You don't. Each method has an absolute limit on the number of byte codes. You have reached that limit. The limit is part of the specification and JVMs will refuse to run classes that exceed the limit. So even if you could compile it, it wouldn't run.
    It is quite common for code generators to generate large monolithic blocks of code. Presumably this is how you got to this spot. Modify the code generator to break it into smaller blocks.
    If you did it manually then you did it wrong. And you will have to manually break it into smaller blocks. (And re-examine your design since it is probably wrong.)

  • Compiling a single .java file

    Hi,
    is it possible to compile a single java class without having to rebuild the complete
    application ? If this is not a feature is it going to be available in SP3 ?
    Thanks
    Mark

    Just put your java classes in a Java project under your application and
    then compile only that project.
    /Steen
    Mark wrote:
    Hi,
    is it possible to compile a single java class without having to rebuild the complete
    application ? If this is not a feature is it going to be available in SP3 ?
    Thanks
    Mark

  • Problem compiling a simple java file

    Hi,
    When I try to compile the following simple java file
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class HowdyServlet extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws IOException, ServletException {
    PrintWriter out = response.getWriter();
    response.setContentType("text/html");
    out.println("<html>");
    out.println("<body>");
    out.println("<center><h1>Hi</h1></center>");
    out.println("</body>");
    out.println("</html>");
    at the command prompt as follows
    C:\Shared\CBT\Java 2 JSP and Java Servlets\03\servlet1>javac -classpath
    "C:\Program Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip" *.java
    Or
    C:\Shared\CBT\Java 2 JSP and Java Servlets\03\servlet1>javac *.java
    Or
    C:\Shared\CBT\Java 2 JSP and Java Servlets\03\servlet1>javac HowdyServlet.java
    I get the following errors and I cannot compile this java file -
    HowdyServlet.java:2: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    HowdyServlet.java:3: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    HowdyServlet.java:5: cannot find symbol
    symbol: class HttpServlet
    public class HowdyServlet extends HttpServlet {
    ^
    HowdyServlet.java:6: cannot find symbol
    symbol : class HttpServletRequest
    location: class HowdyServlet
    public void doGet(HttpServletRequest request,
    ^
    HowdyServlet.java:7: cannot find symbol
    symbol : class HttpServletResponse
    location: class HowdyServlet
    HttpServletResponse response)
    ^
    HowdyServlet.java:8: cannot find symbol
    symbol : class ServletException
    location: class HowdyServlet
    throws IOException, ServletException {
    ^
    6 errors
    I have installed the latest JEE 5 SDK on Win XP Home. I have the following variable set as follows,
    CLASSPATH = .;C:\Program Files\Java\j2re1.4.2_03\lib\ext\QTJava.zip
    PATH = C:\Sun\AppServer\jdk\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\QuickTime\QTSystem;C:\Sun\AppServer\lib\ant\bin
    ANT_HOME = C:\Sun\AppServer\lib\ant
    I have spent hours scratching my head but don?t have a clue. I was wondering if you have any idea as why I might be getting these errors.
    Thank you for your time.
    Green

    Hello, did you read the answers?
    You have to put j2ee.jar or servlet-api.jar in your classpath. Those JAR files are included in the Java EE package somewhere. Remove the QTJava.zip junk from the classpath.
    If you don't know what the classpath is and how to set it, read this:
    Setting the class path
    How Classes are Found
    And I'll repeat what the others say: if you are very new to Java, then Java EE will probably be way over your head. First learn the language and the standard API. If you understand that well, start with Java EE. Or do you already know what servlets are, and that you need a servlet container to run them, and how to deploy them etc.?

  • Deleted the app in the dock that compiles all your open files and fans them out as icons. What is it and how do I get it back?

    When I bought my macbook pro, I deleted the app in the dock that complies all your open files together. When you click on the app it fans all the icons out. What is that app called and how do I find it again/get it back??
    Thanks!

    okay... got that...but before I deleted it, it would "fan" all my open web pages, or open PDF files. So they were in a little folder as opposed to lined up beside my trash bin?
    make any sense?

  • Some compiling problem with java files in JSP

    I wrote a file "ProductManager.java" to use the class of Product to do certain functions which are executed in a jsp, however, there are some curious errors.
    C:\Tomcat\webapps\examples\WEB-INF\classes\com\wrox\begjsp\arrayexample3>javac P
    roductManager.java
    ProductManager.java:5: cannot resolve symbol
    symbol : class Product
    location: class com.wrox.begjsp.arrayexample3.ProductManager
    private Product[] productList = new Product[3];
    ^
    ProductManager.java:20: cannot resolve symbol
    symbol : class Product
    location: class com.wrox.begjsp.arrayexample3.ProductManager
    public Product[] getProductList(){
    ^
    ProductManager.java:28: cannot resolve symbol
    symbol : class Product
    location: class com.wrox.begjsp.arrayexample3.ProductManager
    public Product getProductDetails(int prodid) {
    ^
    ProductManager.java:5: cannot resolve symbol
    symbol : class Product
    location: class com.wrox.begjsp.arrayexample3.ProductManager
    private Product[] productList = new Product[3];
    ^
    ProductManager.java:13: cannot resolve symbol
    symbol : class Product
    location: class com.wrox.begjsp.arrayexample3.ProductManager
    productList[0] = new Product(1,"Wrox Press Beginning JSP",49.99);
    ^
    ProductManager.java:14: cannot resolve symbol
    symbol : class Product
    location: class com.wrox.begjsp.arrayexample3.ProductManager
    productList[1] = new Product(2,"Wrox Press Professional JSP",59.99);
    ^
    ProductManager.java:15: cannot resolve symbol
    symbol : class Product
    location: class com.wrox.begjsp.arrayexample3.ProductManager
    productList[2] = new Product(3,"Wrox Press Beginning Java",39.99);
    ^
    7 errors
    Here is the source code:
    Product.java
    package com.wrox.begjsp.arrayexample3;
    public class Product {
    private int productId;
    private String productName;
    private double productPrice;
    public Product(int prodid, String prodname, double prodprice) {
    productId = prodid;
    productName = prodname;
    productPrice = prodprice;
    public int getProductId(){
    return productId;
    public void setProductId(int ProductId){
    this.productId = ProductId;
    public String getProductName(){
    return productName;
    public void setProductName(String ProductName){
    this.productName = ProductName;
    public double getProductPrice(){ return productPrice; }
    public void setProductPrice(double productPrice){
    this.productPrice = productPrice;
    ProductManager.java
    package com.wrox.begjsp.arrayexample3;
    public class ProductManager{
    private Product[] productList = new Product[3];
    private int productCount;
    public ProductManager() {
    initializeProductList();
    private void initializeProductList() {
    productList[0] = new Product(1,"Wrox Press Beginning JSP",49.99);
    productList[1] = new Product(2,"Wrox Press Professional JSP",59.99);
    productList[2] = new Product(3,"Wrox Press Beginning Java",39.99);
    public Product[] getProductList(){
    return productList;
    public int getProductCount(){
    return productList.length;
    public Product getProductDetails(int prodid) {
    int ProductIndex = -1;
    for(int i=0;i<this.getProductCount();i++) {
    if (prodid == productList.getProductId()) {
    ProductIndex = i;
    break;
    if (ProductIndex != -1) {
    return productList[ProductIndex];
    } else {
    return null;
    Please tell me how to debug it to make it works, thx

    add C:\Tomcat\webapps\examples\WEB-INF\classes to your classpath.
    You can do this through the control panel or by:
    set CLASSPATH=%CLASSPATH%;C:\Tomcat\webapps\examples\WEB-INF\classes

  • 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?

  • 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!!!!

Maybe you are looking for

  • IO Error while creating the Datasource in WLS Console

    Hello, We are using Jdeveloper 11.1.1.1.7, I am trying to create a Data Source using WLS Console, I am getting below error   - I tried creating DB connection using SQL developer with same DB Connection info, it works fine.   - I verified the Port by

  • Problem in FM FB_CONVERT_FORM_TO_XML

    Hello every SDNer, I wanna convert a smartform to a Xml-file with FM FB_CONVERT_FORM_TO_XML. The smartform is 'SF_EXAMPLE_01', but the XML-file has always error. who can help me, to find the problem. the code as following. regards Thanks in advance R

  • Stored procedure with multiple Reference Cursors

    In Sybase and SQLServer, result sets are returned to the application implicitly. Oracle emulates this by passing back weak reference cursors to the application through an IN OUT parameter.The number of reference cursors must match the number of resul

  • Read screen field in infotype 8

    Hi all, I am using exit Exit_SAPFP50M_002 for transaction PA30.In the include, i have to read the basic salary field (Q0008-betrg). But, my problem is Q0008 is structure.How to read the screen field. That value does not exists in any table. Please he

  • Error Me683

    Hi, One of my client is facing a problem very frequently.He creates a PO with 100 to 150 items from the Purchase requisitions once he completes the PO the user saves and he could see the PO number.then after words when he try to see the PO he gets th