Eclipse compile and build path

Hi I'm using Eclipse to build a web application.
Java 5, Mac OS X Leopard, Eclipse j2ee build 3.3.
In my web application I've defined a servlet FooServlet that only handles requests where the url is http://localhost:8080/foo. No other servlet is mapped to this url in the deployment descriptor. The problem I'm having is that FooServlet is not on the build path, but the application runs as though it is. That is, I should be seeing a 404 error when I make a get request for this url and instead I am seeing a page produced by this servlet. I've checked the properties menu of the project and inspected the various areas of the build path, variables, external jars, libraries, etc. It's not there. I've checked the shared and common lib folders of Tomcat. Not there.
It's voodoo. I'm stumped on this one and I really appreciate any help. Thanks in advance.

where your web application is deployed? i.e. from where tomcat takes your web.xml, classes, jars, html's and jsp's?

Similar Messages

  • Ostringstream 10; hangs when compiled and build with -mt option.

    I've written a very simple program to test the use of the stl class ostringstream. The program write an integer to the ostringstream object. In a multithreaded environment (compiled and build with the -mt option), that operation hangs and never returns, whilst it works fine if the program is compiled and build without the -mt option.
    Here is the program :
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <sstream>
    int main() {
    std::ostringstream buffer;
    printf("before writing integer to ostringstream\n"); fflush(stdout);
    buffer<< 10;
    printf("after writing integer to ostringstream.\n"); fflush(stdout);
    printf("exiting.\n"); fflush(stdout);
    return 0;
    Compilation and build :
    CC -mt test.cpp -o test
    Do you any idea why the program hangs at buffer << 10; in a multithreaded environment ?
    (I have tried to write a string instead of a integer, then it works).
    Thanks a lot

    Hi, I've tried your code with Solaris 7 with Forte Developer 6.2, and it seems to work fine. I get the following output:
    before writing integer to ostringstream
    after writing integer to ostringstream.
    exiting.
    My compiler version is:
    CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-03 2001/10/19
    -Moazam

  • Error while compiling and building file [java] ERROR: ejbc couldn't invoke

    *[java] [EJBCompiler] : Compliance Checker said bean was compliant*
    *[java] ERROR: Error from ejbc: Access is denied*
    *[java] java.io.IOException: Access is denied*
    *[java] at java.io.WinNTFileSystem.createFileExclusively(Ljava.lang.Stri*
    ng;)Z(Native Method)
    *[java] at java.io.File.checkAndCreate(File.java:1314)*
    *[java] at java.io.File.createTempFile(File.java:1402)*
    *[java] at java.io.File.createTempFile(File.java:1439)*
    *[java] at weblogic.utils.compiler.CompilerInvoker.execCompiler(Compiler*
    Invoker.java:227)
    *[java] at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(Comp*
    ilerInvoker.java:428)
    *[java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvok*
    er.java:328)
    *[java] at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvok*
    er.java:336)
    *[java] at weblogic.ejb20.ejbc.EJBCompiler.doCompile(EJBCompiler.java:27*
    *0)*
    *[java] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:4*
    *76)*
    *[java] at weblogic.ejb20.ejbc.EJBCompiler.compileEJB(EJBCompiler.java:3*
    *97)*
    *[java] at weblogic.ejbc20.runBody(ejbc20.java:517)*
    *[java] at weblogic.utils.compiler.Tool.run(Tool.java:192)*
    *[java] at weblogic.utils.compiler.Tool.run(Tool.java:147)*
    *[java] at weblogic.ejbc.main(ejbc.java:29)*
    *[java] ERROR: ejbc couldn't invoke compiler*
    BUILD FAILED

    Yshemi,
    You do not have to explicitly point the server to a compiler. Its already in
    the IDE classpath. Can you provide more information on the steps you
    followed.
    You had stated that you had created a new workshop domain. Is this the
    domain in which your are creating the new application ?
    You can choose the server when you create the application or by editing the
    application properties.
    Can you verify this ?
    Can you test the built in sample to check if it works fine ?
    What is the operating system that you are working on ?
    Can you try by creating a new empty application, and an ejb project and let
    me know the results ?
    Regards,
    Raj Alagumalai
    WebLogic Workshop Support
    "yshemu" <[email protected]> wrote in message
    news:3f4eabaf$[email protected]..
    >
    Hi Guys,
    I have created a workshop domain with the configuration wizard.
    I am trying to build a simple EJB - stateless session, has one method
    that returns a string.
    when I try to build I get the following :
    "ERROR: ERROR: Error from ejbc: Compiler failed executable.exec
    ERROR: ERROR: ejbc couldn't invoke compiler
    BUILD FAILED
    ERROR: ERROR: Error from ejbc: Compiler failed executable.exec
    ERROR: ERROR: ejbc couldn't invoke compiler
    Application Build had errors."
    It seems like Workshop can't find the compiler.
    I added "c:\bea81\jdk141_03\bin" to the application properties under
    "server classpath additions" and still get the same error.
    Does anyone know how I can point workshop to the compiler ?
    Thanks
    yshemi

  • Share project configuration with team and Build Path?

    Question 1:
    Is it possible to share the Flex Builder project settings (Flex Build Path, etc.) with other users?  It would be nice to be able to do this so all developers on a team do not have to follow a step-by-step procedure for setting up a project.  For example in a Java Project you can simply check-in the project and classpath files and new developers don't have to spend anytime setting up their ide.  I took a look at what flex is doing and it appears it saves this information (at least some of it) in the plugins directory.  I can't find exactly where but it seems very odd.
    Question 2:
    When setting the Flex build path is there a way to set-up a SWC Folder that recursively adds SWC's in sub-directories?  We pull in Flex libs from artifactory which places them into an un-flattened structure.  Since all the libs are in sub-dirs they are not found.  We have to manually add each lib individually?
    Any ideas on either of these questions?  Thank you.

    Re: Question 1.
    Do you mean check into SVN or similar? Anyway, it seems Flash builder is saving some configuration about build paths etc. in the .actionScriptProperties file, which is found in the root folder of a project. Another option might be to export the project as a Flash Builder project by right-clicking it in the package explorer and choosing Export?
    Re: Question 2.
    Afaik the IDE doesn't support recursively going through a folder to find all swc:s. You could probably solve this using an ANT script. E.g. the following script recursively copies all files with .swc extension from the libraries (AS3) folder to the libs folder of a project.
    <project name="swcTest" default="copy.swc" basedir=".">
        <property name="swc.src" value="${basedir}/../../libraries (AS3)/" />
        <property name="swc.dest" value="${basedir}/libs/" />
        <target name="copy.swc" description="Recursively copies swc files from source to target folder">
            <echo message="${swc.src}" />
            <echo message="${swc.dest}" />
            <copy todir="${swc.dest}" failonerror="true" flatten="true">
              <fileset dir="${swc.src}"
                       includes="**/*.swc"
              />
            </copy>
        </target>
    </project>

  • I am not able to open, compile and build sample plugin projects from Indesign CS4 SDK

    Hi,
    I am new to Indesign plugin development.
    I have downloaded Indesign CS4 SDK Products version for Windows.
    I have downloaded Adobe Indesign CS4 trial version.
    I have Microsoft Visual C++ 6.0 . I want to build sample SDK examples given
    in SDK. But when I open them from visual c++ /prj folder the project is not
    getting opened.
    I want to load Dollyxs and build it and using that develop some projects.
    Also want to build and run the SDK examples .
    So can anybody help about what software I need n which version of visul c++
    is needed for this.And how to Install
    them.
    Thanks n Regards,
    Ravi Sharma

    Hi,
    Thank u very much for your response.
    Now I am getting error as :Error spawning cmd.exe. while I am building project (Indesign cs4-Windows).
    I have set properties for .fr and .rc files .Am I missing any other setting to be made.
    Can u help me?
    Regards,
    Ravi Sharma

  • How to compile and build a war file for JAX-RPC

    Hi all,
    I know that all who use JAX-RPC knows it.
    How to compile JAX-RPC code which was not the sample code of JWSDP example?.
    Which jar file is to be included in classpath?.
    After compiling,how to make a WAR file so i can deploy it in TOMCAT ...anyone plz

    Nobody answers.But i found a right article which was quite helpfull to do it.
    http://java.sun.com/developer/technicalArticles/WebServices/getstartjaxrpc/

  • Missing class in eclipse build path

    Eclipse Platform
    Version: 3.3.2
    Build id: M20080221-1800
    Weblogic Server 10.0
    I use an ant build file to manage building our project, and it generates and compiles without issue. I've got all the Weblogic libraries on the eclipse project build path, but for some reason a generated AuthenticationMBean.java class is importing weblogic.management.commo.StandardInterface which isn't anywhere within the Weblogic 10.0 libraries. It used to be located in weblogic.jar in version 9.1, but I can't find it in 10.0. Eclipse is complaining about it. Can anyone point out where this class now lives?
    Thanks,
    Steve

    For anyone who finds this post with the same problem, the answers are the following:
    C:\bea\modules\com.bea.core.mbean.maker_1.0.1.0.jar
    or
    C:\bea\modules\com.bea.core.mbean.support_1.0.1.0.jar

  • How do I add a jar file into the build path of the compiler?

    Hey,
    I'm trying to import a jar file into the build path of the compilation process, but it does not find the packages or the classes that are in it.
    I think I don't add it right...
              ArrayList<String> options=new ArrayList<String>();
              options.add("-d");
              options.add(targetDirectory);
              options.add("-classpath");
              for(String str:includeDirectory)
                   options.add(str);
              if (!compiler.getTask(writer, fileManager, diagnostics, options, classes, compilationUnits).call());
                    ....and I've tried this way:
         public void setTargetDirectory(String targetDirectory) {
              this.targetDirectory = "-d " + targetDirectory;
         private void compile(Iterable<? extends JavaFileObject> compilationUnits) throws Exception {
              ArrayList<String> options = new ArrayList<String>();
              options.add(targetDirectory);
              String classPath="-cp ";// tried this also with "-classpath"
              for (String str : includeDirectory)
                   classPath+=str+":";
              options.add(classPath);
         if (!compiler.getTask(writer, fileManager, diagnostics, options, classes, compilationUnits).call())
              // throw new Exception("Compilation Error");
         }Thanks in advance,
    Adam.
    Edited by: Adam-Z. on Feb 24, 2010 5:41 AM
    Edited by: Adam-Z. on Feb 24, 2010 5:42 AM

    Thank you for your reply,
    Q: Are there .class files in that directory in that jar file? (the compiler doesn't ( can't )) look for directories, it can just look for specific files , and scan to get a list of all files matching certain criteria. So if there are no class files, it will say the package doesn't exist, even if there is a directory, possibly containing other files.yes there are class files in the jar, the tree structure:
    j2MeDataChunkGenerator_Plugin\(lots of class files)
    META-INF\manifest.mf
    and thats it.
    , your code will only work on windows because other platforms use a different path separator. You should use java.io.File.pathSeparator not explicit ';" when building your classpath. (this is unrelated to your problem, but you should correct it)will do, thanks.
    Q: Is that error in your post formatted by your own diagnostics? (we could possibly help you better if we didn't have to guess!!)I would not post my own error code, this text is generated by the compiler diagnostic.
    {code}
         System.err.println(" Error details: " + diagnostic.getMessage(null));
    {code}
    Q: Is line 3 of ImageCroper_Editor.java (sic) an import statement? (we could possibly help you better if we didn't have to guess!!)it is an import error... didn't the error message stated that it is an import problem? wired, I'm sure before it did. anyway it is an import error.
    Also you don't show us what the variable includeDirectory is in terms of type, and contents, that might be helpful. (we could possibly help you better if we didn't have to guess!!)It has only one String object: "D:\%Important Documents\WorkSpaces\PacMan\ApplicationManager\Plug-in\Data Chunk Designer.jar"
    the last file on the classpath list.
    Q: Have you proven this? that i did post, in this long line of text.
    Q: Is the compiler finding other classes (in other packages) in that same jar file?No. all the class files are in the jar, they all have entries that start with "j2MeDataChunkGenerator_Plugin\*.class", and since I get 47 errors I guess it does not load any other class.
    thank you for you comments, the problem with having these errors, is that I can't even get a piece of information where this error is coming from, only that it is an import loading error package not found, what does that mean? that the jar was not loaded in compilation(no error about this), that the jar is corrupted(no error about this), that the path is incorrect(it is correct I made sure), that there is no such package in the jar(There is), that the compiler does not load the package(does it even do that?), really I can't even guess why this happens, I've been at this on and of all day today, really annoying.
    Thanks,
    Adam.

  • Generic working in eclipse compiler but not through builds

    The following code snippet works fine in my eclipse development environment (1.6.0_06), but the build system running 1.6.0_06 throws exception:
    MyClass:343: incompatible types
    found : java.util.List<C>
    required: java.util.List<B>
    entries = createListFromSmartCopy(myAList, new B(), true);
    Types:
    A is an interface
    B is an interface of A
    C is an implementation of B
    List<A> aList = new ArrayList<A>();
    aList.add(new A());
    List<B> return = createListFromSmartCopy(aList, new C(), true);
        * <p>Creates a copy of a list where the source list could be an ancestor
        * type of the returned list. It also uses a reference object to actually
        * construct the objects that populate the return list.</p>
        * @param <T> - The ancestor type of the source list
        * @param <R> - The derived type of the destination list
        * @param <S> - The more derived type of the prototype object used to
        * construct the list of R's
        * @param sourceList - The source list
        * @param referenceObject - The object used to construct the return list
        * @param deepCopy - Deep copy serializable objects instead of just copying
        * the reference
        * @return a list of R's (as defined by the caller) of entries with the
        * object constructed as a copy of referenceObject with the properties of the
        * sourceList copyied in after construction
    public static <T extends Serializable, R extends T, S extends R> List<R> createListFromSmartCopy(
                List<T> sourceList, S referenceObject, boolean deepCopy)
          List<R> retr = new ArrayList<R>();
          for(int i = 0; i < sourceList.size(); i++)
             retr.add(copyOf(referenceObject));
             copyInto(sourceList.get(i), retr.get(i), deepCopy);
          return retr;
       }Any thoughts on either:
    1. How does this pass the compiler validation inside eclipse, even through 'R' has not been defined? I believe that the code is doing some sort of return type inference to return the exactly correct type of list as referred by the return result or else it is simply ignoring the invariant capture of R all together and silently dropping the error. The funny thing is that the code does work just fine in practice in my development system without an issue.
    or
    2. Why if the code is valid does the independent build system disallow this generic return type 'inference' to occur? Are there compiler flags I can use to withhold this special condition?

    Thanks for the response, I wasn't trying to show a full example but just my implementation's snippet. I'll list one now:
    package test;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.io.Serializable;
    import java.util.ArrayList;
    import java.util.List;
    public class TestMe
        * <p>This method performs a deep copy of an object by serializing and
        * deserialzing the object in question.</p>
        * @param <T> - The type of data to copy
        * @param original - The original object to copy
        * @return The object who's state should be the same as the original. This
        * call uses serialization to guarantee this copy is fully separate from the
        * original, so all sub-object references are also deep copies of their
        * originals
       @SuppressWarnings("unchecked")
       public static <T extends Serializable> T clone(T original)
          T obj = null;
          try
             ByteArrayOutputStream bos = new ByteArrayOutputStream();
             ObjectOutputStream out = new ObjectOutputStream(bos);
             out.writeObject(original);
             out.flush();
             out.close();
             ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(
                      bos.toByteArray()));
             obj = (T)in.readObject();
          catch(IOException e)
             e.printStackTrace();
          catch(ClassNotFoundException cnfe)
             cnfe.printStackTrace();
          return obj;
        * <p>Copies the properties from one object to another. The destined object
        * in this method must be derived from the source object. This allows for a
        * faster and smoother transition.</p>
        * @param <T> The type of source
        * @param <R> The type of destination
        * @param source - The source object
        * @param destination - The destination object
        * @param deepCopy - Copies the reference objects instead of just passing
        * back the reference pointer reference
       public static <T, R extends T> void copyInto(T source, R destination,
                boolean deepCopy)
       // Stubbed because it links into a ton of unnecessary methods
        * <p>Copies the values of a list of an ancestor class into the values of
        * another list who's value is derived from the ancestor.</p>
        * @param <T> - The ancestor type of the source list
        * @param <R> - The derived type of the destination list
        * @param sourceList - The source list
        * @param destinationList - The destination list
        * @param deepCopy - Deep copy serializable objects instead of just copying
        * the reference
       public static <T, R extends T> void copyIntoList(List<T> sourceList,
                List<R> destinationList, boolean deepCopy)
          if(sourceList.size() > destinationList.size())
             throw new IllegalArgumentException(
                      "Cannot copy entire source set into destination list");
          for(int i = 0; i < sourceList.size(); i++)
             copyInto(sourceList.get(i), destinationList.get(i), deepCopy);
        * <p>Creates a copy of a list where the source list could be an ancestor
        * type of the returned list. It also uses a reference object to actually
        * construct the objects that populate the return list.</p>
        * @param <T> - The ancestor type of the source list
        * @param <R> - The derived type of the destination list
        * @param <S> - The more derived type of the prototype object used to
        * construct the list of R's
        * @param sourceList - The source list
        * @param referenceObject - The object used to construct the return list
        * @param deepCopy - Deep copy serializable objects instead of just copying
        * the reference
        * @return a list of R's (as defined by the caller) of entries with the
        * object constructed as a copy of referenceObject with the properties of the
        * sourceList copyied in after construction
       public static <T extends Serializable, R extends T, S extends R> List<R> createListFromSmartCopy(
                List<T> sourceList, S referenceObject, boolean deepCopy)
          List<R> retr = new ArrayList<R>();
          for(int i = 0; i < sourceList.size(); i++)
             retr.add(clone(referenceObject));
             copyInto(sourceList.get(i), retr.get(i), deepCopy);
          return retr;
       public static void main(String[] args)
          List<A> aList = new ArrayList<A>();
          aList.add(new AImpl());
          aList.add(new AImpl());
          List<B> bList = createListFromSmartCopy(aList, new C(), true);
          for(B bItem : bList)
             System.out.println("My String = "
                      + bItem.getString() + " and my number = " + bItem.getInt());
       public static interface A extends Serializable
          public void setString(String string);
          public String getString();
       public static class AImpl implements A
          private static final long serialVersionUID = 1L;
          @Override
          public void setString(String string)
          @Override
          public String getString()
             return null;
       public static interface B extends A
          public void setInt(int number);
          public String getInt();
       public static class C implements B
          private static final long serialVersionUID = 1L;
          public C()
          @Override
          public String getInt()
             return null;
          @Override
          public void setInt(int number)
          @Override
          public String getString()
             return null;
          @Override
          public void setString(String string)
    }In my eclipse (20090920-1017), this compiles and runs just fine. I stripped out the functional pieces that weren't pertinent to the discussion.

  • Eclipse nightmare: Trying to use Build Path without muddling up the project

    I'm working on a team project for the first time ever, which is a little scary. We are using Subclipse. As soon as I downloaded the project, I noticed that I don't get any error warnings. Soon after, I noticed that Ctrl H fails to search the project.
    I thought this was all Subclipse's fault, and tried a clumsy workaround by copying the project. I had noticed that the package icon doesn't appear for the folders holding the source files and realized this is the problem. I guess Eclipse doesn't know which files are the source files. I would have thought it could tell because they end in .java, but that shows how little I know.
    After wrestling with this for hours, I figured out that I could use Build Path -> Use as source folder. For a split second, I thought I had finally solved the problem. But then all of a sudden tons of error messages showed up in every file. It turns out that when you use Build path -> Use as source folder, it moves your source folder and changes the names of the subfolders. So how on earth do I just tell Eclipse where my source files are without it moving everything around and screwing up the whole project?
    Please, somebody tell me what is going on before I pull all of my hair completely out.

    codinatrix wrote:
    I'm working on a team project for the first time ever, which is a little scary. We are using Subclipse. As soon as I downloaded the project, I noticed that I don't get any error warnings. Soon after, I noticed that Ctrl H fails to search the project.
    I thought this was all Subclipse's fault, and tried a clumsy workaround by copying the project. I had noticed that the package icon doesn't appear for the folders holding the source files and realized this is the problem. I guess Eclipse doesn't know which files are the source files. I would have thought it could tell because they end in .java, but that shows how little I know.
    After wrestling with this for hours, I figured out that I could use Build Path -> Use as source folder. For a split second, I thought I had finally solved the problem. But then all of a sudden tons of error messages showed up in every file. It turns out that when you use Build path -> Use as source folder, it moves your source folder and changes the names of the subfolders. So how on earth do I just tell Eclipse where my source files are without it moving everything around and screwing up the whole project?
    Please, somebody tell me what is going on before I pull all of my hair completely out.I have encountered similar issues with Eclipse and--though I'm not an expert--I have used Eclipse a lot.
    Can you tell us more about your project folder structure (as it exists in SVN)?
    Generally speaking, here's what I would do when start a new Eclipse project from SVN using Subclipse:
    1) Delete your current project and start clean.
    2) Open the SVN Repositories view in Eclipse
    3) Right-click the folder you are checking out as your project (for example, if your project is called ProjectFoobar and contains a trunk, right-click the trunk folder... don't check out all of the branches--use svn switch instead) and do a Checkout.
    4) Select 'Check out as a project in the workspace
    5) Give it a project name.
    6) 'Check out HEAD revision' (presumably)
    7) Depth: fully recursive
    8) Next
    9) Workspace location: make sure this the workspace you intend to create the project in
    8) Finish
    Hope that helps.
    -Thok
    Edited by: Thok on Apr 29, 2009 7:07 PM

  • WSDC, build path, and a dirty wsanttasks.jar

    I'm attempting to use some customized Ant tasks for starting/stopping applications in Websphere Development Studio Client 5.1. I added the following line to my build.xml file...<taskdef name="wsStopApplication" classname="com.ibm.websphere.ant.tasks.StopApplication"/>...assuming that such a class might already be supported in the WS environment. Silly me - WS told me it couldn't find that class. So, I dug around and found the wsanttasks.jar buried deep in the bowels of the WS install directory. I dutifully added this JAR to the Ant properties, but got the same result. I added the JAR to the project build path, but still no custom-task love.
    I've checked and re-checked the spelling. I've rebuilt the project. I've shut down and restarted WDSC. The project seems to not even recognize that it has access to the wsanttasks.jar. I was able to compile a class outside WDSC using a class from this JAR.
    I'm open to suggestions as to what I might be missing.
    Thanks,
    &#167;

    google search:
    http://p2p.wrox.com/topic.asp?TOPIC_ID=4606
    I had the same problem, so I can help you on that.
    You need to include 2 jar files into a class path for the wsadmin.
    1) in C:\Program Files\WebSphere\AppServer\bin there is a file called setupCmdLine.bat
    2) edit it and chenge the line
    SET WAS_CLASSPATH=%WAS_HOME%/properties;%WAS_HOME%/lib/bootstrap.jar;%WAS_HOME%/lib/j2ee.jar;%WAS_HOME%/lib/lmproxy.jar;C:/Program Files/WebSphere/AppServer/java/jre/lib/ext/mail.jar;C:/Program Files/WebSphere/AppServer/java/jre/lib/ext/log.jar
    so that includes the MAIL.JAR and LOG.JAR.
    Dunno if this is same as your problem or not.

  • Eclipse build path entry is missing

    Hello, I have just installed Eclipse 3.3 on Ubuntu. When I click on File...New...Java Project, and name my project, the project appears on the left with a small red box indicating an error. The two errors indicated are:
    "The project cannot be built until build path errors are resolved"
    "Unbound classpath container: "Default System Library in project "Test""
    When I right click on the project and on properties, there is another error:
    "Build path entry is missing: org.eclipse.jdt.launching.JRE_CONTAINER"
    I tried to click on "Properties..."add library", and add the JRE system library, but when I click next the window does not move to the next screen. Anyone know how I can create a new project without these errors. Thanks.

    Do you have any JRE libraries configured? I think Eclipse detects one by default.
    You could try posting this on a Eclipse forum where you are likely to get a better response sooner.

  • Difference between javac and eclipse compiler

    I have the following code:
    public class Test {
         public static void main(String[] args) {          
              Integer i = 0;
              double d = 1.5d;
              i += d;
              System.out.println(i);
    }javac gives me the following error:
    Test.java:5: inconvertible types
    found   : double
    required: java.lang.Integer
                    i += d;
                         ^
    1 errorThe Eclipse compiler, however, gladly compiles and the JRE runs it, outputting "1".
    The question is: which compiler is correct?
    javac version 1.6.0_04
    java version "1.6.0_04"
    Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
    Java HotSpot(TM) Client VM (build 10.0-b19, mixed mode, sharing)
    Eclipse JDT version 3.3.1.r332_v20080131

    Integer is probably 32-bit while Double is 64-bit.
    Your code is doing the following;
    - widening the original Integer to Double,
    - performing double-precision addition,
    - assigning the double-precision result to the original Integer.
    Without an explicit cast, your code is asking the compiler to implicitly narrow the double, potentially throwing away data.

  • How to compile and run servlets in Eclipse?

    Does somebody known how can I compile and run servlets in Eclipse IDE? I've added and configured Tomcat's plugin. I've created a project with my example servlets source, and I don't know what farther. How do I have compile it without main method? I must add web.xml file from Tomcat's directory into projects in Eclipse and modify it?
    THX Chudzik

    Try googling for "eclipse servlet", surely someone has written instructions.

  • Wipes out classes and jars in Java Build Path

    Hello!
    All the jar and class files under Library tab gets cleared when I repair my DC project. But when I repair normal projects it does not wipe out  the jars or classes in the Library. Can someone please help me?
    Thanks
    Raj

    Hi Raj,
    The Java build path of a DC-project is based on the definitions in de DC-dependecies (shown in .dcdef file).
    Everytime you repair or build the  DC the build path will be updated into the .project file based on the .dcdef file.
    See the online documentaion for how to add libraries to the DC dependecies.
    Hope this helps.
    Regrads,
    Alain.

Maybe you are looking for

  • Internal Software error

    Hi,  When I compile my fpga target vi i got an internal software error shown in the attached picture. The program I'm working on is somehow complicated and the target file size is about 801KB and I also used 15 target-scoped FIFOs to transfer data wi

  • Refreshing Flash Chart Report based on a Multi-Select List

    I have P13_SYMBOL multiselect list object.. Set "HTML Form Element Attributes" property of P13_SYMBOL to onchange="javascript:getchart(this);" I have written following code at page HTML Header section. <script type="text/javascript"> function getchar

  • Credit/Down payment Request

    Dear Gurus, I am using credit management and assign a credit limit to the customer all ascenario are working fine. But one of my material client is selling on advance basis, so here i want that no credit can be utilize and system need a advance payme

  • ExtendToolscript opens when I call script from photoshop

    Hey, I asked this question over in general discussions by mistake so I though I would re-ask it here. I have a Javascript that I have written that builds a interface of buttons in organised groups based on the contents of certain folders. Everything

  • Pricing Condition List

    Dear Expert, Need small help, I need to prepare a list of all Condition records (except for manual , automatic and Tax pricing PB00, PBXX, NAVS) with its value based on the last 6 months PO. This will help us analyze the no of records captured in pri