• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Package does not exist problem

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I have directory structure like this

C:>work
repos
src
common
-->Record.java
sms
-->Parse.java.



my programs are..

Record.java
-----------
package work.repos.src.common;
public class Record
{
public static void main(String ar[])
{
First f = new First();
f.callMe();
}
}
class First
{
public void callMe()
{
System.out.println("Prit me first");
}

}

Parse.java
------------

package work.repos.src.sms;
import work.repos.src.common.*;
public class Parse
{
public static void main(String arg[])
{
Record record = new Record();

}
}


c:>cd work\repos\src\common
c:\work\repos\src\common>javac Record.java.

I got class file of Record.class and First.class

While I trying to compile this Parse.jave....

c:\work\repos\src\sms>javac Parse.java

I have been getting error like...

package work.repos.src.common does not exit..

is this right way to compile.?
what is the error?
how to set classpath here?

I would be happy if anyone give me the answer?

please....
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Ravisankar Karunanithy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob Prime,

Thank you.

Ravi.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic