p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Other Programming > BOOK: Beginning Algorithms
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 12th, 2006, 01:31 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
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!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 12th, 2006, 08:53 PM
Registered User
 
Join Date: Jul 2006
Location: , , .
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old 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
Default

Hi,

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

Cheers,

Simon

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old June 13th, 2007, 09:48 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
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 ?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old June 13th, 2007, 09:55 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
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


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #6 (permalink)  
Old 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
Send a message via ICQ to SKYDOS
Default

hi there

don't worry, be programmer
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning Java Web Services source code examples ch1cago2la Java Basics 1 May 3rd, 2009 02:52 PM
can't run Beginning Algorithm examples kana BOOK: Beginning Algorithms 1 December 16th, 2007 02:35 PM
Problems running Beginning ASP.NET 2.0 examples ymak ASP.NET 2.0 Basics 0 June 4th, 2006 06: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



All times are GMT -4. The time now is 06:29 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc