Solved

Getting packages to work with Ecilpse

Posted on 2003-12-03
4
899 Views
Last Modified: 2008-02-01
I just recently downloaded the free IDE, Eclipse, and it is great and all, but i am having a lot of troble importing any packages into any of my java programs [I only am trying to use KeyboardReader, Turtle Graphics, and BreezySwing packages from this site www.wlu.edu/~lambertk/hsjava]. From what i can see my program reconizes that the packages exist because whenever i put in any of there names, they turn into a light blue. However, I think that when I put in the import statment [such as import KeyboardReader.*] Eclipe actualyl thinks the import statement is the "public class [put your own name here] { statement" folowing the import statemnt because i always get the dreaded "cannot find main" error in the JVM. The bigger reason why i think this could be true is because when i take away the impor statemtn and anything related with the import statement in the program, the program mysteriously works! if anyone can tell me in a step to step way on how to get packages to work with Eclipse, it would be greatly apprieated.
0
Comment
Question by:Supergoldzero
  • 2
4 Comments
 
LVL 3

Expert Comment

by:savalou
ID: 9869987
To use third-party jars in Eclipse you need to add them to the project classpath.  In the menu go to Project->Properties and in the Properties window click on "Java Build Path" then Libraries and "Add Jars".  Is that what you did?
0
 
LVL 92

Expert Comment

by:objects
ID: 9869996
Have you added the new jar to Eclipse?
0
 

Author Comment

by:Supergoldzero
ID: 9872210
Yeah, that is what i actually did, but it still does not work for some odd reason
0
 
LVL 3

Accepted Solution

by:
savalou earned 135 total points
ID: 9872601
So you did
import KeyboardReader.*;

???
It should be
import TerminalIO.KeyboardReader;

And unless you have the jars in the project directory, I think you need to do "Add External Jars" in the project properties settings.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
micro services vs rest web services 16 103
simple java question 3 55
Java SE 8u111  Lot of stuff broke 11 68
login form jsp example 2 24
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question