Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » compile errors only with a maven project(trying to convert my project to maven; gives me compile errors on standard java interfaces)
compile errors only with a maven project [message #1220003] Sun, 08 December 2013 22:38 Go to next message
Eclipse UserFriend
I have a Swing application that I wrote and completed using eclipse; I create a jar for it, debug it, run it from eclipse, run the jar outside eclipse, use Launch4j to create a windows version which also runs fine, etc. What I am using is eclipse Juno.

I'm studying maven; I created a maven project and copied the source and resource files over to the maven project, and changed the JRE library on the build path to be 1.6 instead of its default (for some reason) of 1.5. But I have errors in the project.

It appears that, everywhere I use an interface and use the @Override annotation for it, I have an error. Eclipse's error is that that method must override a method of the superclass. These are the exact same classes that, in another project that I created without maven, are fine and show no error.

I have verified that the build path has the new source path in it (I had to move source files that used to just be in src to src/java/main and so forth). I have deleted the JRE library and re-added it. I have deleted one of the source files and re-added that. I have used maven clean and build, no change. I have refreshed the project multiple times through all of this, no change. I exited eclipse and started it back, no change.

I used maven on the command line to clean and rebuild the project; it does that without error, and the resulting class files appear to run fine.

Can anyone tell me what is wrong with my maven plugin, or configuration, or project setup, or whatever? I am kinda stumped where to look...
Re: compile errors only with a maven project [message #1220008 is a reply to message #1220003] Mon, 09 December 2013 02:03 Go to previous messageGo to next message
Eclipse UserFriend
Ralph,

What are the source compatibility settings for the project? If it's set
to 1.5 then you can't use @Override for overrides of interface methods,
only for overrides of super class methods.

On 09/12/2013 4:38 AM, Ralph Cook wrote:
> I have a Swing application that I wrote and completed using eclipse; I
> create a jar for it, debug it, run it from eclipse, run the jar
> outside eclipse, use Launch4j to create a windows version which also
> runs fine, etc. What I am using is eclipse Juno.
>
> I'm studying maven; I created a maven project and copied the source
> and resource files over to the maven project, and changed the JRE
> library on the build path to be 1.6 instead of its default (for some
> reason) of 1.5. But I have errors in the project.
>
> It appears that, everywhere I use an interface and use the @Override
> annotation for it, I have an error. Eclipse's error is that that
> method must override a method of the superclass. These are the exact
> same classes that, in another project that I created without maven,
> are fine and show no error.
>
> I have verified that the build path has the new source path in it (I
> had to move source files that used to just be in src to src/java/main
> and so forth). I have deleted the JRE library and re-added it. I
> have deleted one of the source files and re-added that. I have used
> maven clean and build, no change. I have refreshed the project
> multiple times through all of this, no change. I exited eclipse and
> started it back, no change.
>
> I used maven on the command line to clean and rebuild the project; it
> does that without error, and the resulting class files appear to run
> fine.
>
> Can anyone tell me what is wrong with my maven plugin, or
> configuration, or project setup, or whatever? I am kinda stumped
> where to look...
Re: compile errors only with a maven project [message #1220059 is a reply to message #1220008] Mon, 09 December 2013 07:12 Go to previous message
Eclipse UserFriend
That was it. Thanks very much. I did NOT know that about @Override and 1.5/1.6.
Previous Topic:m2e
Next Topic:JAAS Problem
Goto Forum:
  


Current Time: Sat Apr 26 04:08:59 EDT 2025

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

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

Back to the top