These instructions are for importing your Assignment 1 chat bot into your Assignment 2 game project in NetBeans 6.7. They assume that you have already worked through the instructions on getting started with NetBeans. They also assume that you are running on an Informatics DICE machine. If not, hopefully this will at least provide useful ideas on achieving the same thing on your own system.
jwnl.jar
) into a special location in
your BlueJ (!) install directory. Run this command from a terminal
window (or do it by dragging and dropping among folder windows):
cp ~/IJPAssignments/IJPAssignment1/lib/jwnl.jar ~/bluej/lib/userlib/
(Remember that in a terminal window, “~
” is
a shorthand for your home directory.) Obviously this assumes that your
Assignment 1 is in ~/IJPAssignments/IJPAssignment1
, and
that you installed BlueJ in ~/bluej
. If you used different
locations, then adjust the command accordingly.
jwnl.jar
. Start
NetBeans up, and then select the “Options” item under the
“Tools” menu. The Options dialogue box should appear.
Click on the Miscellaneous tab and then the BlueJ sub-tab. You should
see:
Browse to the directory in which you installed BlueJ
(for example ~/bluej
), select that and click OK.
jwnl
and data
) for WordNet. These three
commands will work from a terminal window, for example:
cp -a ~/IJPAssignments/IJPAssignment1/ijp ~/IJPAssignments/IJPAssignment2/ cp -a ~/IJPAssignments/IJPAssignment1/jwnl ~/IJPAssignments/IJPAssignment2/ cp -a ~/IJPAssignments/IJPAssignment1/data ~/IJPAssignments/IJPAssignment2/
… as before, you may need to adjust the directory names. You
can just as well do this using drag-and-drop between folder windows too:
the ijp
, jwnl
and data
directories from your chat bot need to be copied into the
IJPAssignment2
directory..
ijp.assignment1.utils
package and then
right-click on WordNetWrapper.java
. This class has a
main
method which you can run in order to test that WordNet
is working correctly. Select “Run File” from the
right-click menu.
You should see a large amount of text flying past in the Output pane (bottom right of your NetBeans window), finishing with something like this:
Here are the synonyms for the randomly generated noun correlation coefficient_of_correlation, correlation_coefficient, correlation, correlational_statistics, correlativity, Here are the synonyms for the randomly generated verb pitch tilt, huckster, slant, lurch, incline, hawk, sky, gear, deliver, cant, peddle, cant_over, vend, slope, monger, set_up, toss, pitch, flip, shift, Here are the synonyms for the randomly generated adjective primitive rude, archaic, untrained, crude, noncivilised, primitive, noncivilized, early,
In order to be able to use the “Run File” option, your
class must have a main
method. main
is
introduced briefly in 7.15.2 of Objects First with Java; Appendix E
talks about this special method in more detail. Your Game
class already has one, waiting for you to fill it in…
Hopefully this will have got things working for you — but if not, please don't hesitate to ask someone in a lab.
Version 1.3, 2010/11/23 17:44:42
Informatics Forum, 10 Crichton Street, Edinburgh, EH8 9AB, Scotland, UK
Tel: +44 131 651 5661, Fax: +44 131 651 1426, E-mail: school-office@inf.ed.ac.uk Please contact our webadmin with any comments or corrections. Logging and Cookies Unless explicitly stated otherwise, all material is copyright © The University of Edinburgh |