Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Java Programming 24-Hour Trainer by Yakov Fain
This is the forum to discuss the Wrox book Java Programming 24-Hour Trainer by Yakov Fain; ISBN: 978-0-470-88964-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Java Programming 24-Hour Trainer by Yakov Fain 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 January 3rd, 2012, 01:58 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2011
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Question Lesson 12 - Ping Pong Game won't run threads

I am having trouble with getting lesson 12 - Ping Pong Game to run properly. For whatever reason the run() thread will not run unless I set a break-point in the run() function within the Eclipse IDE.

I have tried to run PingPongGreenTable.class from the command line with the same results...

Is there something I need to enable in order to get the threads to run properly?

Thanks in advance!
The Following User Says Thank You to Scott.Ballenger For This Useful Post:
Cristina (February 23rd, 2012)
 
Old February 23rd, 2012, 05:35 AM
Authorized User
Points: 159, Level: 3
Points: 159, Level: 3 Points: 159, Level: 3 Points: 159, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Feb 2012
Location: Romania
Posts: 30
Thanks: 5
Thanked 4 Times in 4 Posts
Default

Hello,

Thanks for posting this question!

I learned a lot from getting the Ping Pong Game to run using the command line.

This is how I finally succeeded:

C:\Eclipse\Cristina\workspace\Lesson12\src\com\pra cticaljava\lesson12>javac
GameConstants.java

C:\Eclipse\Cristina\workspace\Lesson12\src\com\pra cticaljava\lesson12>javac -classpath C:\Eclipse\Cristina\workspace\Lesson12\src PingPongGreenTable.java

C:\Eclipse\Cristina\workspace\Lesson12\src\com\pra cticaljava\lesson12>javac -classpath C:\Eclipse\Cristina\workspace\Lesson12\src PingPongGameEngine.java


C:\Eclipse\Cristina\workspace\Lesson12\src\com\pra cticaljava\lesson12>java -classpath
C:\Eclipse\Cristina\workspace\Lesson12\src com.practicaljava.lesson12.PingPongGreenTable

It took me a while to understand that I needed to use the name of the class together with the name of the package when I execute PingPongGreenTable (com.practicaljava.lesson12.PingPongGreenTable in the last command), although PingPongGreenTable.class is located in the same directory where I execute the JVM.
 
Old April 27th, 2013, 10:21 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multithreading issue

Hi guys I was trying to run the Chapter 12 example on a MAc Book Pro. The game was not working. I fixed the issue making the ballServed variable in the
PingPongGameEngine class volatile.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Example 11 chapter 12 doesn't run baofu_gao BOOK: Beginning JavaScript 4th Edition 1 January 24th, 2011 10:35 AM
I can't get the postback in chapter 12 to run. rhoisy BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 August 22nd, 2008 07:36 AM
Xbox 360 Game (2.0) - Pong darktatami BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 1 January 18th, 2008 05:26 AM
Pong Game Help -XM- BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 4 June 20th, 2007 02:23 PM
Problems with threads. Threads disappearing? DriesNeyrinck VB.NET 0 June 10th, 2003 08:26 AM





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