Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > BOOK: Beginning Algorithms
|
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 Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 12th, 2006, 12:31 PM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!

 
Old July 12th, 2006, 07:53 PM
Registered User
 
Join Date: Jul 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!
 
Old July 14th, 2006, 01:11 AM
Registered User
 
Join Date: Jan 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

You just beat me to it. I was going to suggest exactly that, glad it worked out for you.

Cheers,

Simon

 
Old June 13th, 2007, 08:48 AM
Registered User
 
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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 ?

 
Old June 13th, 2007, 08:55 AM
Registered User
 
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

 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


 
Old November 7th, 2008, 05:35 AM
Registered User
 
Join Date: Nov 2008
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
Send a message via ICQ to SKYDOS
Default

hi there

don't worry, be programmer





Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning Java Web Services source code examples ch1cago2la Java Basics 1 May 3rd, 2009 01:52 PM
Problems running Beginning ASP.NET 2.0 examples ymak ASP.NET 2.0 Basics 0 June 4th, 2006 05:02 AM
Problems with Examples of Beginning with php4 Book xtimox Beginning PHP 2 December 17th, 2004 02:01 PM
unable to run ch 10 examples jgtez JSP Basics 0 February 24th, 2004 09:22 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.