Java 6 upgrade -- ant replicating class files on compilation

On upgradation to java 6 , ant seems to replicated class files
which have already been compiled into jars (which i have mentioned in classpath).
This is the ant script
<javac srcdir="src" destdir="/WEB-INF/classes" classpath="${library.jar}" deprecation="on" debug="true">
<classpath refid="library.classpath"/>
     <include name="com/test1/webapp/common/**/*.java"/>
</javac>
library.classpath contains path to library.jar
The above script works perfectly for java 5 but not for java 6.
The problem is that classes in the folder com/test1 are getting recompiled to WEB-INF/classes, when the classes were already in compiled to library.jar (which is in classpath).
Is there a solution to this problem?

This is the code that I have written:
public class Board extends JApplet
     JPanel p[][];
     public void init()
     try{
     SwingUtilities.invokeAndWait(new Runnable()
          public void run()
                    makeGUI(8,8);
     }catch(InterruptedException e){e.printStackTrace();}
     catch(InvocationTargetException e){e.printStackTrace();}
/* Board*/
private void makeGUI(int rows, int cols)
    p = new JPanel[rows][cols];
    Container contentPane = getContentPane();
    contentPane.setLayout(new GridLayout(rows, cols));
    for (int i = 0; i < rows; i++)
      for (int j = 0; j < cols; j++)
        p[i][j] = new JPanel();
        contentPane.add(p[i][j]);
        if (i % 2 == j % 2)
          p[i][j].setBackground(Color.white);
          else
          p[i][j].setBackground(Color.darkGray);
In this which one is inner class?

Similar Messages

  • How to compile and register a Java CFX tag with multiple class files?

    All-
    If this is the wrong forum for CFX questions, please let me
    know.
    I need to determine how to compile and register a Java CFX
    tag that contains multiple class files. One class file implements
    the CustomTag interface and the other class files implement various
    supporting classes. All of the documentation that I have found
    talks about using a single class file. I am assuming that a JAR
    file will be involved, but I am not sure of the specifics.
    Thanks in advance for your help.
    -Josh

    Yes, it will involve a jar. Use your java IDE (eclipse,
    etcetera ..) to create a jar containing all of the classes. Check
    your ide's documentation for how to create jar files. After you
    have created the jar, place the jar in the CF class path so CF will
    recognize it. For example the {cf_root}/WEB-INF/lib directory. CF
    must be restarted before it will detect the new jar. After
    restarting CF, register the CFX tag in the ColdFusion Administrator
    using the name of the class that implements the CustomTag
    interface.
    Though it is worth noting you can also instantiate java
    classes directly from ColdFusion (ie without using a CFX
    tag).

  • Do we have to separate java source files and class files after compiled..

    Hi,
    I really confussed with this:
    I have compiled java source files into a package and tried to use but the classes can not be found. Should I separate class and source files after compiled with packages names. I hope you understand what i mean.
    Thank you
    So Jag

    You can choose to separate the source files or not. It sounds like your problem has to do with Classpath and packages.
    If the file c:\base\compute\engine\mysourcefile.java starts with the statement "package engine;" then the fully qualified name of the class is is engine.mysourcefile. If the file c:\base\compute\client\mysourcefile.java starts with the statement "package client;" then its fully qualified name is client.mysourcefile.
    In your source files, whenever you refer to a class from another class, the compiler needs the fully qualified class name. You can either import the class or use the fully qualified name. In order for the compiler to find the class, the c:\base\compute directory must be in the Classpath (assuming the package definitions from above).
    Finally, to launch an application given the above, the command would be "java client.mysourcefile" assuming the main method is in client.mysourcefile.

  • I can compile java, but I cannot run class file.

    Exception in thread "main" java.lang.NoClassDefFoundError: Demonstrate
    That is the error I get when I type: java Demonstrate
    I have "C:\j2sdk1.4.0\bin" in the path for the Environment Variables in windows xp. I've even tried to insert that into a CLASSPATH several ways and it does not change the error.
    javac Demonstrate.java works fine. That compiled file can work on other computers. Because of that, I do not think it's a setting error. Any ideas ? Thanks for any help.

    Microsoft problem? I like nothing better than bashing M$, but this sounds like a CLASSPATH problem to me.
    I'll assume that your Demonstrate.java does NOT have a package statement in it and has a main method that you'd like to run. If so, you compile like this:
    javac Demonstrate.javaThe result is a Demonstrate.class file in the same directory as Demonstrate.java.
    Now, type this in the command shell right in the directory where Demonstrate.class lives to run it:
    java -classpath . DemonstrateYou won't get that ClassNotFoundException.
    Whenever you see that exception, it means you don't have your CLASSPATH set properly. - MOD
    You won't get ta

  • JAVA WEB START AND JSP / CLASS FILES

    hi
    We have 3 different servers at client located on the word wide web in
    differne t locations .,
    In case of updation of new jsp / class / .... files can java web start help
    me in such a senirio to sucessfully dwnload the new set of files from
    the main server in our office on to respective web containers servers on
    weekly
    with regards
    karthik
    the servers

    hi
    We have 3 different servers at client located on the word wide web in
    differne t locations .,
    In case of updation of new jsp / class / .... files can java web start help
    me in such a senirio to sucessfully dwnload the new set of files from
    the main server in our office on to respective web containers servers on
    weekly
    with regards
    karthik
    the servers

  • Java - referencing external jar and class files

    When compiling (loadjava) a Java class, how can an externally referenced '.jar file' be resolved please? Using '-resolve' doesn't do the job in this case.
    Many thanks.

    I think I've seen an option for this with manifest files (or was it something that had to do with the java plug-in). There was something about the version and only download a new version if it was newer than the one on your local computer. This version thing is something you define in the manifest file at least. Take a look at jar and manifest files, there might be something there.

  • Execution of one CLASS file ( a compiled program)

    this is a ambiguse problem for me !!!!
    i working with jsdk1.4.1 .
    i can compile programs but can't perform them with "java" !!
    this is error of it :
    (( Exception in thread "main" java.lang.NoclassDefFoundError : file name ))
    anyone can lead & help me !!!
    Thank you for your responses .
    F.Heidary

    Set your classpath.

  • Ant tools: converter java card -  class file  not belonging to the package!

    Hi
    I have another problem with converter. Could you help me please again if you have the time?
    I have created a directory when I save the class files generated by javac. After That , I use convert in this way:
    <convert
    JCA="true"
    EXP="true"
    CAP="true"
    packagename="testUn/classes/testUn"
    packageaid="0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x02:0x00"
    majorminorversion="1.0"
    verbose = "true">
    <AppletNameAID
    appletname="testUn.classes.testUn.PorteAppUn"
    aid="0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x01:0x02:0x00:0x00"/>
    <classpath refid="classpath"/>
    </convert>
    Here is the answer of the computer:
    [echo] Generation of the CAP,JCA and EXP files...
    [convert] Java Card Ant Tasks, Version 1.0
    [convert] Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    [convert] Note: Usage of Java Card Ant Tasks is optional. Java Card Ant Tasks are not supported by Sun Microsystems, Inc.
    [convert] Java Card 2.2.2 Class File Converter, Version 1.3
    [convert] Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
    [convert] parsing /home/ehoudart/app-manager/VersionZero/src/testUn/classes/testUn/PorteAppUn.class
    [convert] converting testUn.PorteAppUn
    [*convert] error: class PorteAppUn does not belong to package testUn.classes.testUn.*
    [convert] conversion completed with 1 errors and 0 warnings.
    I do not understand why this unique applet class file does not belong to its own package. Is someone an idea?
    Thanks very much in advance for your answer.

    Here is a complete example build.xml (I think I have posted this before).
    <?xml version="1.0" encoding="UTF-8" ?>
    <project default="convert" name="javacard-starter">
      <!-- Build specific properties -->
      <property name="target.classes" location="${basedir}/target/classes" />
      <property name="target.javacard" location="${basedir}/target/javacard" />
      <property name="source.java" location="${basedir}/src/main/java" />
      <!-- Must point to the folder containing the JAR files from the JCDK -->
      <property name="javacard.libs" location="${basedir}/lib" />
      <!-- Must point to the folder containing the JAR file from the JCDK ant task -->
      <property name="javacard.ant-task" location="${basedir}/lib" />
      <!-- Must point to the folder containing the API export files from the JCDK -->
      <property name="javacard.export" location="${basedir}/src/main/export" />
      <property name="verbose" value="true" />
      <property name="noverify" value="false" />
      <!-- Path for JC tasks -->
      <path id="classpath">
        <fileset dir="${javacard.ant-task}">
          <include name="*.jar" />
        </fileset>
        <fileset dir="${javacard.libs}">
          <include name="*.jar" />
        </fileset>
      </path>
      <!-- set the export path to the Java Card export files -->
      <path id="export" description="set the export file path">
        <fileset dir="${javacard.export}">
          <include name="**/*.exp" />
        </fileset>
        <pathelement path="${javacard.export}" />
        <pathelement path="${target.classes}" />
        <pathelement path="${target.javacard}" />
      </path>
      <!-- Definitions for tasks for Java Card tools -->
      <taskdef name="capgen" classname="com.sun.javacard.ant.tasks.CapgenTask" classpathref="classpath" />
      <taskdef name="deploycap" classname="com.sun.javacard.ant.tasks.DeployCapTask" classpathref="classpath" />
      <taskdef name="convert" classname="com.sun.javacard.ant.tasks.ConverterTask" classpathref="classpath" />
      <taskdef name="verifyexport" classname="com.sun.javacard.ant.tasks.VerifyExpTask" classpathref="classpath" />
      <taskdef name="verifycap" classname="com.sun.javacard.ant.tasks.VerifyCapTask" classpathref="classpath" />
      <taskdef name="verifyrevision" classname="com.sun.javacard.ant.tasks.VerifyRevTask" classpathref="classpath" />
      <typedef name="appletnameaid" classname="com.sun.javacard.ant.types.AppletNameAID" classpathref="classpath" />
      <typedef name="jcainputfile" classname="com.sun.javacard.ant.types.JCAInputFile" classpathref="classpath" />
      <target name="init">
        <mkdir dir="${target.classes}" />
        <mkdir dir="${target.javacard}" />
      </target>
      <target name="clean">
        <delete dir="${target.classes}" />
        <delete dir="${target.javacard}" />
        <delete dir="${javacard.eeprom}" />
      </target>
      <target name="compile" depends="init" description="Compile source code to class files">
        <!-- Compile the java code from ${src} to ${classes} -->
        <javac debug="yes" optimize="no" srcdir="${source.java}" destdir="${target.classes}" source="1.5" target="1.5">
          <classpath refid="classpath" />
        </javac>
      </target>
      <target name="convert" depends="compile" description="Convert class files to cap files">
              <convert packagename="chaining" packageaid="0xF0:0x00:0x00:0x01:0x00:0x01" majorminorversion="1.0" classdir="${target.classes}" outputdirectory="${target.classes}" jca="true" exp="true" cap="true" debug="true" verbose="${verbose}" noverify="${noverify}">
                   <appletnameaid aid="0xF0:0x00:0x00:0x01:0x00:0x01:0x00:0x01" appletname="chaining.ChainingApplet" />
                   <exportpath refid="export" />
                   <classpath refid="classpath" />
              </convert>
      </target>
      <target name="copy-debug">
        <mkdir dir="${target.debug}" />
        <echo>Copying cap files</echo>
        <copy flatten="true" todir="${target.debug}" verbose="true">
          <fileset dir="${target.classes}" includes="**/*.cap" />
          <fileset dir="${target.classes}" includes="**/*.exp" />
          <fileset dir="${target.classes}" includes="**/*.jca" />
        </copy>
      </target>
      <target name="all" depends="clean, convert" />
    </project>

  • How to read the java class file to convert it in java.

    hello all,
    i m developing the java application which generated the java code from the java 'class file' .
    Can anybody please help me, Is any java support for reading the class file? or how to know the class file format?
    I know the application javad, jad, javap which is doing the same thing.
    thanks for reply,
    - Jayd

    do you mean decompiling? there are tons of java decompilers available out there, what exactly are you trying to do here?

  • Thiz iz Urgent..........How to convert a .class file to a .java file

    Hi Everybody,
    I want to convert back a .class file (a compiled servlet) into .java (source code) file. How do I do it???
    Note using javap has not been of any help.
    Thanks in Advance
    Rajib

    Why don't you look at this thread:
    http://forums.java.sun.com/thread.jsp?forum=31&thread=143500
    If thats not enough, try searching all the forums for:
    "convert .java .class" That'll give yu a bunch of other threads...
    Sjur

  • Than how can i get java class by using it's class file?

    Hi
    After compilation of a java program, it creates a class file.
    After getting class file suppose class file has been deleted.
    Than how can i get java class by using it's class file?
    Thanks in advance.

    get a decompiler and run your class file through it--I'll assume you want the source code back and that you are not trying to recover a missing class file by attempting to use the class file that is missing--if it's missing, then I've not a clue on how to get it back by using what is already missing.
    BTW: many of your compilers have source control--if it does, just restore your missing file.

  • Why require cap file why not only class file as in java

    why do we convert .class to .cap file why not simply load the .clss file to the card

    If Java Card has to accept .class file, it's certain
    that JCVM developers are going to spend more and more
    nights in their office.
    Just kidding. I'm one of them.LOL :)
    Put the CAP file converter on-card.

  • Java not running .class files

    I rebooted my computer, and now whenever I type
    java <filename> it responds with:
    C:\Development\Java\Projects\Scratch>java T1
    Exception in thread "main" java.lang.NoClassDefFoundError: T1
    However, it compiles fine:
    class foo {
    class T1 {
        public static void main (String [] args) {
            foo [] fooArray = new foo[5];
            if (fooArray[1] instanceof Object)
              System.out.println("fooArray[1] is an object");
            if (fooArray[1] instanceof foo)
              System.out.println("fooArray[1] is a foo");
    }What am I missing to get it to run with java T1?
    (every other class file that used to work behaves the same way)

    Yes, it is the classpath. Strangely . is in my classpath in the environment settings in the control panel. I guess I can survive adding -cp . but it is kind of a pain in the a__ for no reason I can discern

  • HELP!!! java.lang.ClassFormatError: (Truncated class file)

    Hello all,
    I'm writing a ClassLoader and the funniest things are happening. If I load a compiled class for the first time after compilation everything is ok. Once I change the class and recompile it, it starts putting out java.lang.ClassFormatError: (Truncated class file). If I alter the changes back to normal and recompile. It works again. Is there some sort of buffer which keeps the once loaded class in memory, even after rebooting?
    Please help, I'm at a loss
    Gideon

    hi dmbdmb,
    I got following error when try to run a java code in JBoss.
    15:39:56,696 ERROR [LogInterceptor] Unexpected Error:
    java.lang.ClassFormatError: Thilina (Truncated class file)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:448)
    at com.sun.tools.javac.v8.StringCompiler$Loader.findClass(StringCompiler
    .java:63)
    at com.sun.tools.javac.v8.StringCompiler.executeMethodWithReturnType(Str
    ingCompiler.java:120)
    at cc.aot.qVoice.domain.ejb.qVoiceManager.qVoiceManagerEJB.getVxmlString
    (qVoiceManagerEJB.java:125)
    I use JBoss 3.0.6 and sdk 1.4. In my program, classes are create and load on the fly. Then using Reflection API I called some
    methods in the dynamically created class(this class not
    write into a file and it is taken as a String variable).
    I refferd this url as a guid to write class loader and compiler.(actually same thing i copied
    from there and change it's name Pmat1 to StringCompiler)
    http://forum.java.sun.com/thread.jsp?thread=347467&forum=4&message=1439418
    When I run this as a normal application, it is work well. Then I try to run it in a jboss and it will give the above error.
    In here I Wote some EJBs and struts also and i called the methodds in the StringCompiler(Pamat1) class in a EJB. Thilina is
    the name of the dynamically created calss and StringCompiler is the class that includes the class loader and compiler methods
    as in the above url. qVoiceManagerEJB has a getvxmlString method. Whithin this method
    i called required the methods in the String compiler.
    Can u some body help me. Thanx in advanced for any help.
    anjithalb

  • How to reload class file for java objects in CF MX7

    I'm trying to create a simple java object for use in a CFML
    page. According to the topic "About ColdFusion and Java objects" in
    the CF developer's guide, I can compile my java module and put the
    .class file in the CFusionMX7/wwwroot/WEB-INF/classes directory and
    it'll be dynamically reloaded any time CF sees a new .class file
    there. But the dynamic reload isn't happening; I have to restart
    the CF server to get it to pick up a new version.
    I don't believe this directory is in the "general JVM
    classpath"; I don't find "classes" in the Java Class Path in the CF
    Administrator's System Information page. And I have all the caching
    options turned off on the "Server Settings > Caching" page, if
    that has any bearing on it.
    Are there any known issues around this dynamic reload
    capability, or maybe a more definitive way to make sure the
    WEB-INF/classes directory isn't in the classpath?
    Thanks,
    James

    Yes, I understand. But if I'm reading it correctly, what
    you're saying seems to contradict the documentation
    http://livedocs.adobe.com/coldfusion/7/htmldocs/00001561.htm
    ColdFusion dynamically loads classes that are either .class
    files in the web_root/WEB-INF/classes directory or in JAR files in
    the web_root/WEB-INF/lib directory. ColdFusion checks the time
    stamp on the file when it creates an object that is defined in
    either directory, even when the class is already in memory. If the
    file that contains the class is newer than the class in memory,
    ColdFusion loads the class from that directory.
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_18228&sliceId=1
    Dynamic class reloading for Java servlets classes and
    forcfobject (sic) Java classes is disabled by default in
    ColdFusion MX. To enable dynamic class reloading, do the following:
    Also, I seem to recall that setting worked in a prior
    version. Though I would have to test it again on another machine to
    be certain.

Maybe you are looking for

  • Two different TOC styles in one Pages document?

    I'm a new Pages 2.0.2 user with a large document with two different tables of contents 20 pages apart. I'm trying to format them differently using different TOC styles but when I change one's style the other one changes as well. Anything I do format-

  • JDeveloper hosted docs not working

    Maybe my JDeveloper is not setup appropriately to point to the appropriate location, but the documentation links to http://otn.oracle.com/hosted_doc/jdev/oracle/jbo/ViewObject.html are unavailable. Where are the javadocs now? Please advise, Joe

  • How to protect my iphone from scratched

    How to protect my iphone from scratched

  • How to specify Complex Type Parameter

    Hi, Can anyone tell me how to specify a complex type parameter using the AddServiceDefinition command in the fnscript? Thanks Pao Wang NMR

  • Telstra Air: connection issue on app or at hotspot

    After login either on app or at hotspot I get the following dialog, "SOMETHING WENT WRONG: Sorry, but we couldn't connect you to Telstra Air. Please try again later." The front line staff at the call centre advised me the issue is "Telstra Air provis