Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in compiling - package does not exist

 
Anand Sivathanu
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i have a java file in WEB-INF\classes
simpleServlet.java

I have to access a jar file present in WEB-INF\classes\lib
jtds12.jar

in simpleServlet.java

I have mentioned the path of jtds12.jar in classpath

I have import the jar file in java

import lib.jtds12.*;

public class simpleServlet extends HttpServlet
{
}

when compile,telling error that package does not exist

D:\weblogic\weblogic81\anand_project\WEB-INF\classes>javac simpleServlet.java
simpleServlet.java:10: package lib.jtds12 does not exist
import lib.jtds12.*;
^
1 error


please guide me
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to put jtds12.jar in your CLASSPATH. Try to compile using "-cp D:\weblogic\weblogic81\anand_project\WEB-INF\jtds12.jar"
 
Anand Sivathanu
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe Verré wrote:You have to put jtds12.jar in your CLASSPATH. Try to compile using "-cp D:\weblogic\weblogic81\anand_project\WEB-INF\jtds12.jar"


I have put jtds12.jar in classpath.

compile with -cp, i cannot understand.
please explain breifly
 
Rob Spoor
Sheriff
Pie
Posts: 20531
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Compiling and the class path are Java 101. Moving to Beginning Java.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic