*
The moose likes Beginning Java and the fly likes error in compiling - package does not exist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "error in compiling - package does not exist" Watch "error in compiling - package does not exist" New topic
Author

error in compiling - package does not exist

Anand Sivathanu
Ranch Hand

Joined: Jun 25, 2010
Posts: 76
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

Joined: Nov 24, 2005
Posts: 14687
    
  16

You have to put jtds12.jar in your CLASSPATH. Try to compile using "-cp D:\weblogic\weblogic81\anand_project\WEB-INF\jtds12.jar"


[My Blog]
All roads lead to JavaRanch
Anand Sivathanu
Ranch Hand

Joined: Jun 25, 2010
Posts: 76
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

Joined: Oct 27, 2005
Posts: 19557
    
  16

Compiling and the class path are Java 101. Moving to Beginning Java.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: error in compiling - package does not exist
 
Similar Threads
jar file contains
Servlet Compilation Error
what classpath export to compile asterisk java code
Need help urgently: problems compiling servlets
package does not exist