Eclipse Error Declared Package Does Not Match Expected Package
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack
The Declared Package Does Not Match The Expected Package Main
Overflow the company Business Learn more about hiring developers or posting ads with us the declared package does not match the expected package src Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a the declared package does not match the expected package java community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How do I fix a “declared package does not match the expected package” error on
The Declared Package Does Not Match The Expected Package Maven
Eclipse? up vote 6 down vote favorite 4 I've feel like I have gone through the proper steps to fix this error, and I've looked at other questions about this in SO and other places, but for some reason I'm still having an issue. I am trying to set up a project using the Apache JMeter source code. As an example, the file BeanShellAssertion.java is in ~/workspace/apache-jmeter-2.9/src/components/org/apache/jmeter/assertions. My source folder is
Resource Does Not Have A Corresponding Go Package Eclipse
src/components. The package declaration in BeanShellAssertion.java is package org.apache.jmeter.assertions; Looking at it, it seems like everything is set up the way it is supposed to be. However, the package declaration is causing an error: The declared package "org.apache.jmeter.assertions" does not match the expected package "components.org.apache.jmeter.assertions" Image is below. What exactly am I doing wrong here? java eclipse share|improve this question edited Jul 15 '13 at 20:57 asked Jul 15 '13 at 20:40 TennSeven 2431617 1 Did you try a clean rebuild? –Yogendra Singh Jul 15 '13 at 20:56 As per Jigar's suggestion below, I did, and that did the trick! I had tried a refresh and rebuild, but without the "clean," which is apparently the step it needed. Thank you! –TennSeven Jul 15 '13 at 21:01 add a comment| 2 Answers 2 active oldest votes up vote 5 down vote accepted put your src/components/ to source path right click > properties > java build path > source > add folder > select src/components share|improve this answer answered Jul 15 '13 at 20:44 Jigar Joshi 159k27266332 I've already done that. If you look at the screenshot, you can see that src/components is a source folder, and that org.apache.jmeter.assertions is supposedly a path under that folder, but Ecli
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this go package name is empty site About Us Learn more about Stack Overflow the company Business Learn more
Eclipse Package Declaration
about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x editor does not contain a main type Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Eclipse says http://stackoverflow.com/questions/17663521/how-do-i-fix-a-declared-package-does-not-match-the-expected-package-error-on-e package declaration does not match expected package “” up vote 2 down vote favorite 3 I am using Maven to build my project. When I view it in Eclipse, it complains that package declaration does not match expected package "" Maven is able to successfully build the project though. eclipse maven share|improve this question edited May 27 '13 at 13:45 rethab 1,271625 asked May http://stackoverflow.com/questions/16773385/eclipse-says-package-declaration-does-not-match-expected-package 27 '13 at 12:37 Chetan 4741726 1 If you are using maven, I suggest using 'mvn eclipse:eclipse' and then import it as a regular java project (Import existing). –rethab May 27 '13 at 12:40 The folder WebContent does not look like a usual Maven WAR project. –khmarbaise May 27 '13 at 12:41 @rethab: It really worked for me , thanks so much.Idk , why others down voting here. –Chetan May 27 '13 at 12:51 @Chetan I edited my Answer to include a little bit more background (see below). –rethab May 27 '13 at 13:40 add a comment| 1 Answer 1 active oldest votes up vote 7 down vote accepted Eclipse needs to recognize a certain folder as a 'Source Folder' in order to correctly interpret the contents as Java source files. Typically, if you create a Java project, Eclipse creates one folder called 'src' and marks it as 'Source Folder'. If you are dealing with a default Maven project setup, however, Eclipse will not automagically recognize 'src/main/java' as a source folder (unless you are using a plugin of course). If you are not
Things LocationTech Long-Term Support PolarSys Science OpenMDM More Community Marketplace Events Planet Eclipse Newsletter Videos Participate Report a Bug Forums https://www.eclipse.org/forums/index.php/t/369033/ Mailing Lists Wiki IRC How to Contribute Working Groups Automotive Internet of Things LocationTech Long-Term Support PolarSys Science OpenMDM Toggle navigation Home Projects Forums Eclipse Community http://forums.devshed.com/java-help-9/eclipse-sdk-declared-package-match-expected-package-317204.html Forums Forum Search: Search Help Register Login Home Home» Newcomers» Newcomers» the declared package "" does not match the expected package - does not SOLVED(Probably just simple problem) Show: Today's Messages :: Show Polls :: Message Navigator the declared package "" does not match the expected package - SOLVED [message #900197] Sun, 05 August 2012 09:14 M MMessages: 1Registered: August 2012 Junior Member Hello, I've been trying to learn Java with tutorial from youtube, but declared package does since i cant post link i can only sane that it is name "Java Video Tutorial" from user "derekbanas", but the problem I have with it is that when he started recording, he already had his eclipse set up and started project with file already in it. Now everytime I try to do what he does, I get the error the declared package "" does not match the expected package. This is what I do: Start Eclipse, new workspace in Eclipse folder,E:\Eclipse\workspace File>New>Java Project enter>use default JRE (currently jre7),name "Test" press Finish Expand Test>right click on src>New package>name package defaultPackage in source folder Test/src>Finish Right click defaultPackage>New File>HelloWorld.java Enter code>Ctrls+s to save BAM, declared package does not match the expected package. What Am I doing wrong that I am getting the error? Thanks for your time SOLVED: Instead of creating new package, I just clicked on SRC and created new file, naming it HelloWo
Search Username Password Remember Me? Register Lost Password? facebook google twitter rss Free Web Developer Tools Advanced Search Forum Programming Languages Java Help [Eclipse SDK] "The declared package does not match the expected package" Thread: [Eclipse SDK] "The declared package does not match the expected package" Share This Thread Tweet This + 1 this Post To Linkedin Subscribe to this Thread Subscribe to This Thread January 10th, 2006,08:40 AM #1 No Profile Picture demmith View Profile View Forum Posts Visit Homepage Contributing User Devshed Newbie (0 - 499 posts) Join Date May 2004 Location Virginia Posts 71 Rep Power 15 [Eclipse SDK] "The declared package does not match the expected package" This is the error I see in the Eclipse SDK 3.1.1 IDE. All I want to do is familiarize myself with the environment by working with some simple Java programs. Its a little disconcerting when I cannot get by the first line of the program. I have a project named "Ch04" and the first line of my source reads, package Ch04; Seems simple enough doesn't it? I have a directory named "Ch04" where my source file is located so it shouldn't be a 'classpath' problem - at least I don't think it should. So what is the magic formula? Thanks. Dave Faq January 10th, 2006,10:51 AM #2 mrider View Profile View Forum Posts <- My daily commute :^) Devshed Intermediate (1500 - 1999 posts) Join Date Mar 2005 Location Earth. Welcome. Posts 1,500 Rep Power 1700 Most likely what's wrong is that your project properties point to the wrong place in order for the classpath to work. In order for Eclipse to separate your projects, you need a directory that contains the project. Then you should