Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro Java
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Pro Java Expert level Java questions not about a specific book. Please indicate your version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Java section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 22nd, 2007, 02:21 AM
Registered User
Join Date: Aug 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default JAR file


Is there anyone know how to make the classes of a package available to other classes? I did create a JAR file and put it in C:\Program Files\Java\jdk1.6.0_02\jre\lib\ext directory. I also created the classpath to that JAR file.

However, when I tried to import the jar file by using statement "import jarFile.*; ", it complains...say that " the jarFile cannot be resolved".

Anyone know how to fix this problem?!


Reply With Quote
  #2 (permalink)  
Old August 23rd, 2007, 08:27 AM
Friend of Wrox
Join Date: Mar 2007
Location: Hyderabad, A.P., India.
Posts: 373
Thanks: 0
Thanked 1 Time in 1 Post

First the import statement is used to import classes, it should never contain jar file names.
suppose your jar file contains a class package1.innerpackage.MyClass class; then the import statement should look like
import package1.innerpackage.MyClass;
import package1.innerpackage.*;

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading xml file which is in a JAR file pradheepayyanar J2EE 2 December 26th, 2007 05:52 AM
import file from jar geek.shrek XSLT 3 November 9th, 2007 06:19 AM
cant use jar file SweeT EviL Java Basics 1 October 9th, 2007 11:48 AM
JAR File Obfuscate Anandharaj Struts 0 September 26th, 2007 07:43 AM
Accessing properties file outside jar file anand_indya J2EE 0 December 8th, 2004 06:34 AM

All times are GMT -4. The time now is 12:43 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.