|
|
 |
BOOK: Beginning Algorithms  | This is the forum to discuss the Wrox book Beginning Algorithms by Simon Harris, James Ross ; ISBN: 9780764596742 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning Algorithms section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

July 12th, 2006, 01:31 PM
|
|
Registered User
|
|
Join Date: Jul 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
can't run Beginning Algorithm examples
I'd like to buy this book, but I can't get the examples to run. I followed the instructions in the readme.html and compiled the files for chap 3 successfully. But I can't run the test.
Here is my dos output on Windows XP professional (with my jvm at C:\Program Files\Java\jdk1.5.0_07):
First I followed the book instructions and entered:
C:\BeginAlgorithms>java -classpath junit.jar:main:test junit.textui.TestRunner com.wrox.algorithms.l
ists.ArrayListTest
Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/TestRunner
Then I tried specifying the classpath like so:
C:\BeginAlgorithms>set CLASSPATH=C:\BeginAlgorithms\junit.jar;C:\BeginAlg orithms\test
And I got the following:
C:\BeginAlgorithms>java junit.textui.TestRunner com.wrox.algorithms.lists.ArrayListTest
Exception in thread "main" java.lang.NoClassDefFoundError: com/wrox/algorithms/iteration/IteratorOut
OfBoundsException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at junit.runner.StandardTestSuiteLoader.load(Standard TestSuiteLoader.java:11)
at junit.runner.BaseTestRunner.loadSuiteClass(BaseTes tRunner.java:193)
at junit.runner.BaseTestRunner.getTest(BaseTestRunner .java:86)
at junit.textui.TestRunner.start(TestRunner.java:171)
at junit.textui.TestRunner.main(TestRunner.java:138)
Any suggestions? Thanks. If you help me figure it out, I'll buy the book!
|

July 12th, 2006, 08:53 PM
|
|
Registered User
|
|
Join Date: Jul 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I discovered the problem. I just needed to change the colons after the java -classpath command to semicolons(i.e. "junit.jar:main:test" needed to be "junit.jar;main;test" under Windows). I guess the colons are meant for unix. Sorry. I'm a newbie. Anyway, I'm off to get what looks like an excellent book. Maybe in a later edition you could have a parenthetical warning for newbies in the readme.html that colons need to be semicolons under Windows.
At the risk of being overly polite, thanks for the help I'm sure I would've received!
|

July 14th, 2006, 02:11 AM
|
|
Registered User
|
|
Join Date: Jan 2006
Location: Melbourne, Victoria, Australia.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
You just beat me to it. I was going to suggest exactly that, glad it worked out for you.
Cheers,
Simon
|

June 13th, 2007, 09:48 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I was just looking at this book and I am new to programming but I could not compile the code. I
unziped the files on lunix.
I have ~/java/Beginning Algorithms/Beginning Algorithms/*
~/java/junit3.8.1/junit.jar
CLASSPATH= ~/java/junit3.8.1
Do I move junit.jar ~/java/Beginning Algorithms/Beginning Algorithms/* ?
I do I make
javac -classpath junit.jar -sourcepath main test/com/wrox/algorithms/lists/*.java
and
java -classpath junit.jar:main:test junit.textui.TestRunner com.wrox.algorithms.lists.ArrayListTest
to work ?
|

June 13th, 2007, 09:55 AM
|
|
Registered User
|
|
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I was just looking at this book and I am new to programming but I could not compile the code. I
unziped the files on lunix.
I have ~/java/Beginning Algorithms/Beginning Algorithms/*
~/java/junit3.8.1/junit.jar
CLASSPATH= ~/java/junit3.8.1
Do I move junit.jar ~/java/Beginning Algorithms/Beginning Algorithm
How do I make the readme.html work?
javac -classpath junit.jar -sourcepath main test/com/wrox/algorithms/lists/*.java
and
java -classpath junit.jar:main:test junit.textui.TestRunner com.wrox.algorithms.lists.ArrayListTest
|

November 7th, 2008, 05:35 AM
|
|
Registered User
|
|
Join Date: Nov 2008
Location: Chisinau, Moldova, Moldova.
Posts: 4
Thanks: 2
Thanked 0 Times in 0 Posts
|
|
hi there
don't worry, be programmer
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |