Duplicate Class Compilation Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have
Duplicate Class Error In Ant Build
Meta Discuss the workings and policies of this site About Us duplicate class error netbeans Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with error duplicate class android studio us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers,
Error Duplicate Class Maven
just like you, helping each other. Join them; it only takes a minute: Sign up Why would compiler fail on duplicate class if they belong to different packages? up vote 0 down vote favorite I got this inherited project using Maven/m2e as the build automation tool. All nice & cool except that this project, checked out
Java Duplicate Class Error
of SVN as is, is broken... meaning it fails to build, with several duplicate class errors: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.1:compile (default-compile) on project myproj: Compilation failure: Compilation failure: [ERROR] \Users\Daniel\workspace\myproj\target\generated-sources\cxf\org\package1\services\ClassA.java:[36,7] duplicate class: org.package1.services.ClassA Now, it's true that ClassA exists in the build environment 3 times: c:/Users/Daniel/workspace/myproj/src/main/java/org/package1/services/ClassA.java c:/Users/Daniel/workspace/myproj/src/main/java/org/package1/www/services/ClassA.java c:/Users/Daniel/workspace/myproj/target/generated-sources/cxf/org/package1/services/ClassA.java But they belong to different packages: package org.package1.services; package org.package1.www.services; So, why would the compiler complain about a duplicate class? (Or is it Maven that's complaining?) I am not familiar with the design considerations of the original author, so any idea how to resolve these duplicates would be much appreciated. java maven m2e share|improve this question asked Dec 6 '12 at 13:51 Withheld 1,80442854 add a comment| 3 Answers 3 active oldest votes up vote 4 down vote accepted You've got three classes, in two packages. Therefore two of the classes are in the same package. These two files: .../myproj/src/main/java/org/package1/services/ClassA.java .../myproj/target/generated-sources/cxf/org/package1/services/ClassA.java ... are both contributing org.package1.services.ClassA (which is the fully-qualified class name the compiler is complain
class when there is no duplicate class Summary: Reporting duplicate class when there is no duplicate class Status: REOPENED duplicate class found in file android studio Product: java Classification: Unclassified Component: Source Version: 7.3 Hardware: PC Windows 7 x64
Duplicate Class Buildconfig
Priority: P3 (vote) TargetMilestone: 7.3 Assigned To: Svata Dedic QA Contact: issues@java URL: Whiteboard: Keywords: Depends on: Blocks: duplicate class mapping found Show dependency tree /graph Reported: 2013-02-19 16:43 UTC by cmd1234 Modified: 2016-01-01 05:50 UTC (History) CC List: 1 user (show) MackSix See Also: Issue Type: DEFECT Exception Report : http://stackoverflow.com/questions/13745003/why-would-compiler-fail-on-duplicate-class-if-they-belong-to-different-packages Attachments uplocateclass.png (102.43 KB, image/png) 2014-06-03 09:21 UTC, Zom-B Details View All Add an attachment (proposed patch, testcase, etc.) Note You need to log in before you can comment on or make changes to this bug. Description cmd1234 2013-02-19 16:43:26 UTC Its actually version 7.3 RC2 Get duplicate class error when there is no duplicate class. Program compiles up correctly with no errors. https://netbeans.org/bugzilla/show_bug.cgi?id=226360 Have deleted cache files, but problem persists. When loaded into Netbeans 7.2 I have no problems at all. Comment 1 cmd1234 2013-02-19 17:09:23 UTC Got around the problem I didn't know that netbeans has two places where is caches files. had deleted ~/Library/Application\ Support/NetBeans/7.3rc2 but also need to delete ~/Library/Caches/NetBeans/7.3rc2 so its just the old cache problem. Comment 2 Tomas Danek 2013-02-27 15:31:50 UTC closing then. Comment 3 psammalisto 2013-03-22 19:19:28 UTC I got that error when I copied a backup over the file in src folder. I could find the class name only in the class file and in project properties as main.class, it cannot be found e.g. anywhere in files in ~folder. Comment 4 Tomas Danek 2013-04-10 09:14:46 UTC Did you try wiping out the cache (like ~/Library/Caches/NetBeans/7.3 ) ? (In reply to comment #3) > I got that error when I copied a backup over the file in src folder. I could > find the class name only in the class file and in project properties as > main.class, it cannot be found e.g. anywhere in files in ~folder. Comment 5 Zom-B 2014-06-03 09:13:30 UTC
error Summary: Duplicate Class error Status: VERIFIED INCOMPLETE Product: java Classification: Unclassified Component: https://netbeans.org/bugzilla/show_bug.cgi?id=197983 Source Version: 8.1 Hardware: PC Windows 7 Priority: P3 with 5 votes (vote) TargetMilestone: 7.3 Assigned To: Jan Lahoda QA Contact: issues@java URL: Whiteboard: 72patch-candidate Keywords: Duplicates: 198466 215437 (view as bug list) Depends on: Blocks: Show dependency tree /graph Reported: 2011-04-22 05:12 UTC by debopamg Modified: 2016-06-08 08:01 UTC (History) CC List: 9 users (show) duplicate class emanuel_ hennr nnovic ovrabec pwvirgo scgm11 slass100 steveoh444 tombart See Also: Issue Type: DEFECT Exception Report : Attachments screencap showing duplicate file warning (68.57 KB, image/png) 2011-07-19 18:26 UTC, slass100 Details ~/.netbeans/var/log/message.log (40.59 KB, text/plain) 2011-07-19 18:28 UTC, slass100 Details View All Add an attachment (proposed patch, testcase, etc.) Note You need to log in before duplicate class error you can comment on or make changes to this bug. Description debopamg 2011-04-22 05:12:46 UTC Product Version = NetBeans IDE 7.0 RC1 (Build 201103280000) Operating System = Linux version 2.6.35-28-generic running on i386 Java; VM; Vendor = 1.6.0_24 Runtime = Java HotSpot(TM) Client VM 19.1-b02 There was a git merge conflict, and after resolving it (outside the IDE, using Meld), I find that the IDE is reporting the conflicted class as Duplicate class. I am using the GIT plugin. Comment 1 Ondrej Vrabec 2011-05-17 09:39:11 UTC What does it mean "Duplicate class"? Can you make a screenshot? Comment 2 Ondrej Vrabec 2011-05-19 08:19:36 UTC Please explain further Comment 3 debopamg 2011-05-19 09:29:47 UTC The problem occurs under the following circumstances: 1. the netbeans git plugin is installed 2. a merge/rebase is performed with the remote git repo 3. there is a conflict in one of the files 4. the conflict is resolved using an external tool (like Meld) 4. after the conflict is resolved, and the change commited, netbeans shows Dup