• 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

Packages??

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am having some problem in compiling packages. i will list down the directory structure below:
C:\Java\people\Person.java
C:\Java\people\employee\Employee.java
C:\Java\people\employee\Manager.java





Whenever i try comiling Employee.java, i get error as even though i have imported Person.java

C:\Java\people\employee>javac Employee.java
Employee.java:3: cannot resolve symbol
symbol : class Person
location: package people
import people.Person;
^
Employee.java:7: cannot resolve symbol
symbol : class Person
location: class people.employee.Employee
public class Employee extends Person
^
2 errors
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you compile Person as part of the people package, the qualified name becomes "people.Person.class," and this is located in the "Java" directory. So change the current directory to C:\Java. Then compile with...

C:\Java>javac people/Person.java
C:\Java>javac people/employee/Employee.java
[ December 04, 2007: Message edited by: marc weber ]
 
Rohit chandra
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot.Could you please tell me how to compile the main method that exist in java directory.


I get error as


C:\Java>javac EmployeeTest.java
EmployeeTest.java:14: not a statement
System,out.println(mgr.getDetartment() + "Manager " + mgr.getNam
e() + "works in" + mgr.getDepartment());
^
EmployeeTest.java:14: ';' expected
System,out.println(mgr.getDetartment() + "Manager " + mgr.getNam
e() + "works in" + mgr.getDepartment());
^
2 errors


 
marc weber
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rohit chandra:
System,out.println...


Looks like a comma where there should be a period.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic