• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Head First - MiniMiniMusicCmdLine

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
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
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.
 
Teri Fisher
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using JCreator.
 
Marshal
Posts: 79649
380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 79649
380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 79649
380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JCreator -> Help menu -> contents -> JCreator Manual -> Building and running code -> How to : set the main arguments -> etc.
 
Teri Fisher
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 79649
380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried the "show command line" and "prompt for arguments" boxes, and that worked.
 
marc weber
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

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
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't been able to find the "show command line" or the "prompt for args"
 
Campbell Ritchie
Marshal
Posts: 79649
380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 79649
380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't access Runtime Configuration.......
 
Campbell Ritchie
Marshal
Posts: 79649
380
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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'd appreciate it if you pronounced my name correctly. Pinhead, with a silent "H". Petite ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic