Solved

Getting packages to work with Ecilpse

Posted on 2003-12-03
4
898 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
Comment Utility
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
Comment Utility
Have you added the new jar to Eclipse?
0
 

Author Comment

by:Supergoldzero
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
nestparen challenge 4 55
topping2 challenge 13 56
java set up 1 46
HashMap Vs TreeMap 12 48
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This video teaches viewers about errors in exception handling.

744 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now