The Artima Developer Community
Sponsored Link

Java Answers Forum
Package

9 replies on 1 page. Most recent reply: Mar 5, 2004 9:21 PM by Kevin

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 9 replies on 1 page
areza12001@yahoo.com

Posts: 4
Nickname: reza123
Registered: Mar, 2004

Package Posted: Mar 2, 2004 9:42 AM
Reply to this message Reply
Advertisement
hello
I have downloaded a package from internet
I want to use its classes by importing the package
using jcreator
I have done alot of things to add ths new pachage to the
current packages with can be importet
but unfortunatly it is useless
please help


twc

Posts: 129
Nickname: twc
Registered: Feb, 2004

Re: Package Posted: Mar 2, 2004 11:27 AM
Reply to this message Reply
> hello
> I have downloaded a package from internet
> I want to use its classes by importing the package
> using jcreator
> I have done alot of things to add ths new pachage to the
> current packages with can be importet
> but unfortunatly it is useless
> please help

If the package is in a .jar file, try putting a copy in the jre/ext folder. Since you are developing, you will have two. One for the JRE, and one for the SDK. Be sue to put a copy in both.

areza12001@yahoo.com

Posts: 4
Nickname: reza123
Registered: Mar, 2004

Re: Package Posted: Mar 4, 2004 9:35 AM
Reply to this message Reply
hello
thanks for your attention
you see I unzipped the zip folder with contains the packages like awt
then I copied my package there then I zipped it again
but it made no diffrence
whould you please help me
and tell me more

thanks alot

twc

Posts: 129
Nickname: twc
Registered: Feb, 2004

Re: Package Posted: Mar 4, 2004 7:40 PM
Reply to this message Reply
> hello
> thanks for your attention
> you see I unzipped the zip folder with contains the
> packages like awt
> then I copied my package there then I zipped it again
> but it made no diffrence
> whould you please help me
> and tell me more
>
> thanks alot

awt is part of the standard Java installation. Are you trying to install Java?

If not, are the files in a .zip file or a .jar file? I'm pretty sure (but not positive) that Java libraries have to be in .jar files.

areza12001@yahoo.com

Posts: 4
Nickname: reza123
Registered: Mar, 2004

Re: Package Posted: Mar 5, 2004 2:34 AM
Reply to this message Reply
you see
I just tried to put my package in the folder where othere packages exist
and other packages where in a zip folder

twc

Posts: 129
Nickname: twc
Registered: Feb, 2004

Re: Package Posted: Mar 5, 2004 5:48 AM
Reply to this message Reply
> you see
> I just tried to put my package in the folder where othere
> packages exist
> and other packages where in a zip folder

I don't really understand what you are trying to do. Do you have Java already installed? If so, what can you tell me about this package that you are trying to install (other than the fact that it is part of a .zip file).

Charles Bell

Posts: 519
Nickname: charles
Registered: Feb, 2002

Re: Package Posted: Mar 5, 2004 8:42 AM
Reply to this message Reply
Modify your classpath environment variable to include the the path to the classes or to a jar file.
That's all there is to it.

areza12001@yahoo.com

Posts: 4
Nickname: reza123
Registered: Mar, 2004

Re: Package Posted: Mar 5, 2004 8:52 AM
Reply to this message Reply
hello
my story is this
I have bought a book in the name of object oriented programming in java
witch has a site in the web
and witch uses the classes of a predefined package in the name of: javabook
I have installed java on my pc
I want to be able to import this new package in my program
like the way I can import awt or applet ....
I searched for the packages folder on my pc
I found that they are in a jar or zip format
I unzipped that folder
then copied that javabook package there
then unzipped the whole again
and deleted the old zip folder that contained the packages

but still when I write the word import in jbuilder
or in jcreator the name of javabook dont appear while
the name of othere packages appear

there was a recommendation on the site
to put the path in the autoexe.bat
but it didntwork eather

twc

Posts: 129
Nickname: twc
Registered: Feb, 2004

Re: Package Posted: Mar 5, 2004 8:18 PM
Reply to this message Reply
Did you find the ext folders? Since you have apparently installed the SDK, you should have two. Do a search for JRE. You should find the ext folder somewhere in the JRE folder. Here is the path for the machine that I'm typing on.

C:\Program Files\JavaSoft\JRE\1.4.2\lib\ext

Since you have the SKD installed, you will have a second somewhere in that folder. Probably a path something like this.

C:\j2sdk1.4.2\JRE\lib\ext

This machine doesn't have the SDK, so I'm working from memory. But it should be something close to the above path.

Put the package (as a .jar file) in the ext folders. That should work if the package is properly created. Since you've unzipped and zipped it back up, you may have inadvertantly corrupted it. You may need to download it again.

Kevin

Posts: 25
Nickname: doublek321
Registered: Jan, 2004

Re: Package Posted: Mar 5, 2004 9:21 PM
Reply to this message Reply
> hello
> I have downloaded a package from internet
> I want to use its classes by importing the package
> using jcreator
> I have done alot of things to add ths new pachage to the
> current packages with can be importet
> but unfortunatly it is useless
> please help

From what I understand of your question you probably need to set the environment variable called "CLASSPATH" to the directory name where you put the jar file (you can put the jar file anywhere you want by the way). The way to set the CLASSPATH varies depending on the OS. Here's a webpage that describes how to set it for Windows 95, 98, 2000 and XP...

http://cs.colgate.edu/APCS/Java/JavaSystemsPages/classpath.htm

Flat View: This topic has 9 replies on 1 page
Topic: Date parsing Previous Topic   Next Topic Topic: How to parse ', (, ) and other special characters

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use