how to Create a Java Package from MATLAB Code?

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

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

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.