how_to_install_the_library_in_eclipse
How to an Add an External Library like kareljrobot.jar in an Eclipse Project
- Go tho the workbench, Under the
File
menu, selectNew Java Project
- In the
JRE
area, selectuse an execution environment JRE J2SE-1.5
- In the
Project Layout
area, selectUse project folder as root for sources and class files
- Uncheck
create module-info
java file. - Press the
Finish
button, even if you don't speak Finnish. - Now right-click the new Project and select
Preferences
at the bottom (or pressAlt-Enter
or pressCommand-I
on a mac orControl-I
on Windows) - Click once on the third tab called
Libraries
- Click the second button down called
Add External JARs
- Place the
KarelJRobot.jar
file you downloaded earlier into your new project folder (Do this usingFinder
on Mac orFiles
on Windows) - Go back to eclipse and select the
KarelJRobot.jar
file you just dropped into the project folder. - Press the
Open
button - Press the
Apply and Close
button - Make a new class
RCRunner
to test it out: From the File menu, selectNew → Class
(or press theC+
button. ) and name classRCRunner
. Paste the follwing code:
import java.awt.Color; import kareltherobot.*; public class RCRunner implements Directions { // Main entry point public static void main(String[] args) { World.setDelay(10); World.placeBeepers(2, 1, 1); World.setVisible(); RemoteControl karel = new RemoteControl(3, 1, East, 3 , Color.RED); } }
how_to_install_the_library_in_eclipse.txt · Last modified: 2024/09/03 18:08 by frchris