File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
marten kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
David McCombs
Ranch Hand
Posts: 212
  • 0
  • Mark post as helpful
  • send pies
  • 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 kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • 0
  • Mark post as helpful
  • send pies
  • 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 kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • 0
  • Mark post as helpful
  • send pies
  • 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...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic