Java- Eclipse Build Error : The declared package "com.my.package" dose not match with the expected package
-
Let me thank all and yahoo Answeres, i have been asking and answering for some time now.. please see my question below The filesystem where my source is located looks like this. C:\tradingsystem\tds\accountmgmt\main\co… The code in test.java looks like below. package com.tds.accountmgmt.dblayer; public class test { .... code here } When i create a project in Eclipse, i am creating a from existing source, and the path is C:\tradingsystem\tds. When i create the project and at the build time i am getting the follwoing error... The declared package "com.tds.accountmgmt.dblayer" dose not match with the expected package. When i complie the same test.java, it compiles (I have the folowing path in my Classpath- C:\tradingsystem\tds\accountmgmt\main ) Can any one please let me know why Eclipse giving this error
-
Answer:
Most probably when you created your class file using new-->class there is a option to create a package which you might have left it blank.So when you are mentioning package name in test.java its giving that error. go to folder tradingsystem\tds\accountmg see whether folder structure is com-->tds-->accountmgmt-->dblayer If it is not that way my guess is right.
harimack at Yahoo! Answers Visit the source
Related Q & A:
- How to build my own Java Math library?Best solution by Yahoo! Answers
- Why am I getting an "Expected Identifier" error?Best solution by Stack Overflow
- How to properly build java library?Best solution by Stack Overflow
- Build me a T-mobile Package?Best solution by Ask Ubuntu
- How do cancel my subscription to match.com?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.