File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Head First - MiniMiniMusicCmdLine Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Head First - MiniMiniMusicCmdLine" Watch "Head First - MiniMiniMusicCmdLine" New topic
Author

Head First - MiniMiniMusicCmdLine

Teri Fisher
Ranch Hand

Joined: Jan 07, 2008
Posts: 52
I give up, I've been trying to change the instrument and note args for this thing and all I get is the message "Don't forget the instrument and note args". What am I doing wrong?
Thanks
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

When you run the command line version, you need to supply command-line arguments, as shown in the graphic at the bottom of page 346. The first argument (0-127) specifies the instrument, and the second argument (0-127) specifies the note. If you supply less than 2 arguments, then you will see the message you are describing.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Teri Fisher
Ranch Hand

Joined: Jan 07, 2008
Posts: 52
I am using JCreator.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38068
    
  22
JCreatorLE or the posh version? I think you can probably supply command-line arguments to JCreator.
I used to use JCreator all the time, simply saving the files to a folder then using the command-line instructions on that folder. Worked nicely!
Teri Fisher
Ranch Hand

Joined: Jan 07, 2008
Posts: 52
I guess the posh version. I thought I could just add-- mini(10,100); or plug args in somewhere below but it's not working.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38068
    
  22
Use System.err rather than System.out in the main method because you are printing an error.

I shall have to reboot and see what I can find in JCreator; it only works on windows and I am on Linux at present.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38068
    
  22
JCreator -> Help menu -> contents -> JCreator Manual -> Building and running code -> How to : set the main arguments -> etc.
Teri Fisher
Ranch Hand

Joined: Jan 07, 2008
Posts: 52
I was wrong, it is LE which is maybe why the runtime Config is greyed out. Plus I have run everything else in this book from JCreator.
[ April 18, 2008: Message edited by: Teri Fisher ]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38068
    
  22
I tried the "show command line" and "prompt for arguments" boxes, and that worked.
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Teri Fisher:
I am using JCreator.

Uh... Okay. Let us know if Campbell's advice cleared things up for you. If not, I'll move this to the IDE forum for further discussion.
Teri Fisher
Ranch Hand

Joined: Jan 07, 2008
Posts: 52
I haven't been able to find the "show command line" or the "prompt for args"
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38068
    
  22
I've only got LE too; you don't seriously think I'd pay for it, do you?

What I described worked nicely; if you have trouble I'll go back to Windows and try giving more detail about what I did.
Teri Fisher
Ranch Hand

Joined: Jan 07, 2008
Posts: 52
I haven't set up my path and such to run it from the command prompt, I'll have to look back at my notes to refresh my memory.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38068
    
  22
I see you are over on this forum now.
You ought to have the PATH set up when you start JCreator.

What it said in help was to go to build.

JCreator->Build->Configuration->highlight "default"->edit->run application tag->highlight "default"->edit->parameters tab->mark the boxes to prompt for main method arguments->OK->OK.

That worked when I tried it earlier.
Teri Fisher
Ranch Hand

Joined: Jan 07, 2008
Posts: 52
I can't access Runtime Configuration.......
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38068
    
  22
Try putting your classes into a project, then click the name of the project first, then you should get a the runtime configuration.

You can save the classes from JCreator and run them from an ordinary command line.

It is because of this sort of thing that we usually recommend not using an IDE as a beginner.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Head First - MiniMiniMusicCmdLine
 
Similar Threads
Head First Java Ch 11 Example
WA #1.....word association
Upcasting.....Its confusing
Head First Java Chapter 11, example on page 346
Head First Java - Chapter 11 - MiniMusicCmdLine Error