Solved

Getting packages to work with Ecilpse

Posted on 2003-12-03
4
901 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Notify sent to other threads in Java 9 54
Eclipse Java import and method not resolved 4 140
Eclipse with various Java releases 7 92
Java import explained 4 49
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
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…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.
Suggested Courses

752 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