Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » [Eclipse Compiler] Differences IDE vs headless build
icon5.gif  [Eclipse Compiler] Differences IDE vs headless build [message #644398] Fri, 10 December 2010 22:01 Go to next message
Michael Heiss is currently offline Michael HeissFriend
Messages: 25
Registered: July 2009
Junior Member
Hi,

We have a strange issue regarding warnings that the Eclipse Java Compiler generates in the IDE and when executing a headless build. I will show you a snippet that produces the warning:

package pkg;

public interface Foo {

    @Target(ElementType.TYPE)
    @Retention(RetentionPolicy.RUNTIME)
    public static @interface Bar {
      ....
     }
}

package pkg2;
import pkg.Foo.Bar;

@Bar
public class TestClass {
}


The compiler in the IDE is not complaining about anything but during the headless build we are getting a "unused import" warning: The import pkg.Foo.Bar is never used. But thats actually not true, because the import is used and when removed causes a compile error Smile

We are using Eclipse 3.6 for development and in the nightly build, so the versions are matching. Can anybody explain the differences and what we can do to avoid the warning?

Best regards,
Michael

Re: [Eclipse Compiler] Differences IDE vs headless build [message #644555 is a reply to message #644398] Mon, 13 December 2010 09:32 Go to previous message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
I don't see any problem if I use the following command line
%java -jar c:\ecj.jar -source 5 -classpath "." pkg2\TestClass.java

Note the options 'source 5' tells to assume the source code is in 1.5 mode and by specifying the 'classpath', the compiler knows where to search for the packages.
Previous Topic:Why does eclipse try to compile all other open projects when I run a unit test
Next Topic:Java extension and java.g file grammar
Goto Forum:
  


Current Time: Fri Apr 19 22:23:22 GMT 2024

Powered by FUDForum. Page generated in 0.02910 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top