Solved

Getting packages to work with Ecilpse

Posted on 2003-12-03
4
900 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet doXXX methods 3 62
MySqlDump not dumping triggers 1 43
mysql jsp example issue 32 51
Adding multiple JVM environments to RedHat 6 7 49
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 Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

828 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