This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling Methods

 
Muhammad Uzair Baig
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I make a simple java class with 2 static methods. When i try
to call these methods in my Servlet error is shown by the compiler.
Compiler can not identity the class. What can i do.

Best regards
Uzair Baig
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may not have the classes in the right place or your classpath is not set up correctly. You need to provide more information though.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13056
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be sure to put your "simple Java class" in a package. Classes not in packages may not be found because the JVM looks in the "current" directory.
Bill
 
Muhammad Uzair Baig
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
Dear Bosun and william i already try lot of classpaths and package techniques. But nothing would be happen . Please if u have any other idea or have some different classpath n package technique to plz send me. I will be very thankful to u.
mail me on
uzaircaps@yahoo.com
Best Regards
Uzair Baig
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic