开发者

@Override error when java project transferred from ubuntu to xp

开发者 https://www.devze.com 2023-01-05 06:37 出处:网络
My current task is taking a Java project written and developed in Ubuntu NetBeans (extensively using the palette, which, it seems to me, locks me into continuing to use NB开发者_运维问答) and transfer

My current task is taking a Java project written and developed in Ubuntu NetBeans (extensively using the palette, which, it seems to me, locks me into continuing to use NB开发者_运维问答) and transferring it to XP, as it involves software that interfaces with a webcam and the client strictly uses XP. In Ubuntu, the project compiles correctly and completely, with the exception of the few functionality problems I was tasked to fix.

So using Subversion, I checked it into NB on a VirtualBox running XP, and added, as far as I could tell, all the correct libraries that were called in the code. A few problems remain, almost all related to @Override annotations above methods that are part of an inner class that extends org.jdesktop.application.Task<Boolean, Void>. I have researched this and have a very vague understanding of what @Override denotes, but am not sure how to apply it to my situation.

The consistency of the problem throughout multiple classes suggests I have not correctly done my classpath, but I cannot find any errors there. In your experience, what sort of problem do these circumstances suggest?

EDIT: I forgot to mention that I had already tried what seemed to be the most common suggestion; everything is freshly installed, the JDK used on both machines is 1.6.

EDIT EDIT: The error takes place inside:

private class TakeSnapshotTask extends org.jdesktop.application.Task<Boolean, Void>

And at the first line of the following:

@Override
protected Boolean doInBackground() 

I get the following error:

"method does not override or implement a method from a supertype"

It appears as though @Override denotes something similar to overloading operators as in C, only with methods. In this case, I'm starting to think the problem is that jdesktop's Task interface doesn't have the Boolean doInBackGround() method. I'm having a hard time pinning down the jdesktop API, however. I've added jdesktop as a tag.


My first thought would be case sensitivity, but that would usually manifest the other way (i.e. file is found in Windows but not in Linux). Could it be possible that you have files in your project with the same name but in different cases? In this case, Windows might just be finding a different (and apparently, wrong) version of some file compared to the case-sensitive match on Ubuntu.

In any case, it would probably help if you posted the actual error messages, rather than us having to guess the problem from "almost all related to @Override annotation".


The platform/OS is irrelevant. The error strongly suggests that you are running the code in two different Java environments.

Double-check that you are not only compiling the code against a 1.6 JDK but also that you are executing it on a 1.6 JVM as well.


Problem solved. A JAR file was missing from the library. It was news to me that the .class files within them were accessible, thanks to Ha!

0

精彩评论

暂无评论...
验证码 换一张
取 消