Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can't able to compile javabean file

 
V K Gupta
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am having two javabean files dog.java and person.java inside tomcat/webapps/jsp7/web-inf/classes/foo


----------------------------------------------------------
code of dog.java
----------------------------------------------------------
package foo;

public class Dog {
String name;

public void setName(String name) {
this.name = name;
}

public String getName() {
return name;
}
}

---------------------------------------------------------------------------------
code of person.java
-------------------------------------------------------------------------------
package foo;

public class Person {
String name;
Dog dog;

public void setDog(Dog dog) {
this.dog = dog;
}
public void setName(String name) {
this.name = name;
}

public Dog getDog() {
return dog;
}

public String getName() {
return name;
}
}

The problem is : dog.java files compiles very well, but person.java is not able to compile it shows an error : cannot find symbol Dog
 
harilal ithikkat
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javac -d . *.java
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65104
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

For more information, please read this.

This post has been moved to a more appropriate forum.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic