• Post Reply Bookmark Topic Watch Topic
  • New Topic

using .jar files  RSS feed

 
Paula Davis
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so I was going to post this in the "beginner" forum, but having seen there the threat of a stiff penalty, I guess I'll venture here just in case
There are some java classes (not from Sun) that I need to use in some code that I am writing. I got the appropriate .jar files and placed one copy in C:\jdk1.3.1_03\lib and another copy in the same directory where the classes I'm writing are located. My JAVA_HOME is set to C:\jdk1.3.1_03
What else do I need to do in order for the compiler to find/use the classes from these .jar files? The error I'm getting says
cannot resolve symbol
symbol : class TheClassImTryingToImport
location: package text
import com.companyname.text.TheClassImTryingToImport;
 
John Lee
Ranch Hand
Posts: 2545
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paula:
you need to specifically refer to any .jar file you want to use in your classpath: example, if you have your somejarfile.jar located at C:\jdk1.3.1_03\lib then you need to not only specify the directory, but also the specific jar file in your classpath. The entry should look like:
C:\jdk1.3.1_03\lib\somejarfile.jar
then you can import classes contained within the jar file.
Jamie
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!