• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Head First Java P346 - MiniMusic Apps - hanging and not returning to the command line

 
Ranch Hand
Posts: 226
1
jQuery Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A quick question, I think.

I am running the MiniMusicCmdApp class below - it compiles and almost functions as expected, except after it makes the sound the class hangs (blinking cursor - see image), and I have to close down Command Prompt, reset my path etc when I reopen it.

Is this a bad class, or is there something wrong with my computer settings?

Thanks

Marten




EDIT by mw: Added Code Tags.
[ February 24, 2007: Message edited by: marc weber ]
 
Ranch Hand
Posts: 212
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure why it is hanging, but you can use cntl-c to force the program to shut down. Check the books website to see if there is a known problem in the code.

Sorry I couldn't be more helpful.
[ February 24, 2007: Message edited by: David McCombs ]
 
marten koomen
Ranch Hand
Posts: 226
1
jQuery Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

but you can use cntl-c to for the program to shut down



Thanks David, while it does not solve the problem, it does help a lot.

Marten
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At the end of the try block (immediately after calling player.start();), try adding the following...

This will cause a 2-second pause (which should be long enough for the player to play the note you specified), after which it will close the Sequencer and exit the program.
[ February 25, 2007: Message edited by: marc weber ]
 
marten koomen
Ranch Hand
Posts: 226
1
jQuery Postgres Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Marc, this did the trick and I am one step further on the OO journey. Not sure why they did not include in the book... probably did not want to confuse the message...
reply
    Bookmark Topic Watch Topic
  • New Topic