LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-16-2005, 01:27 PM   #1
Birgi
Member
 
Registered: Oct 2004
Distribution: Mandrake 10.1
Posts: 40

Rep: Reputation: 15
Importing a package


Hi everybody,

I am trying to use an open source package for java, which is called JFreeChart. I downloaded it and as it says in the installation guide, i wrote the command "ant compile". The build was successful and it created a .jar file in the jfreechart-1.0.0-pre2 folder.

And now my problem comes...

I am trying to import the package as follows,

import org.jfree.*;

and getting this error,

no such package...

Am I doing something wrong or missing?

Thanks

Birgi
 
Old 03-16-2005, 03:42 PM   #2
andvin
LQ Newbie
 
Registered: Nov 2003
Location: Sweden
Distribution: gentoo
Posts: 11

Rep: Reputation: 0
You need to tell the compiler where to find the classes you want to import, i.e. adding the jar file to the classpath

Like this for the standard sun jdk

javac -classpath TheJarfile.jar:someother.jar:yetanother.jar YourJavaSource.java
 
Old 03-17-2005, 01:03 AM   #3
Birgi
Member
 
Registered: Oct 2004
Distribution: Mandrake 10.1
Posts: 40

Original Poster
Rep: Reputation: 15
andvin,

I do the following,

Project > Properties > Required Libraries > New > Add Archive >

and select the created .jar file. But it still does not work???

By the way I am using JCreator LE.

Thanks

Birgi
 
Old 03-17-2005, 03:45 AM   #4
andvin
LQ Newbie
 
Registered: Nov 2003
Location: Sweden
Distribution: gentoo
Posts: 11

Rep: Reputation: 0
Try using a command line tool instead and show us the output if that doesn't work...
I have no clue whatsoever of the IDE you are using, maybe someone else can help you with that.
 
Old 03-17-2005, 03:47 PM   #5
Birgi
Member
 
Registered: Oct 2004
Distribution: Mandrake 10.1
Posts: 40

Original Poster
Rep: Reputation: 15
andvin,

One of the creators of the JFreeChart solved the problem. I had to add another package called JCommon. I did not know it. It is working know...

One day if you use JFreeChart do not forget to add also the JCommon .jar file. It will be in the lib directory of jfreechart-1.0.0-pre2 directory...

Thanks alot

Birgi
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with importing subtitles vegetassj2 Linux - Software 2 08-09-2005 12:00 PM
Importing IE e-mails Rutnut Linux - General 5 05-29-2004 08:35 AM
Importing a script? Panzerfrost Slackware 1 11-04-2003 11:37 AM
importing??? mojozoox Linux - Software 3 08-25-2003 07:43 AM
Importing Favorites TX_metalhead Linux - General 0 01-23-2002 09:32 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration