Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

<Terminated, exit value: 0>, but no output from println command  RSS feed

 
Jw Riggs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm as green as they come, so be gentle...

I'm trying to capture some MIDI events and throw them into an ArrayList so that our other program can then iterate through them and display the notes using Batik. I have the following code, but when I run or debug it, I just get the following message:

<terminated, exit value: 0>C:\Program Files\Java\jre7\bin\javaw.exe (Sep 5, 2013, 1:51:50 PM)

which, from what I can gather, means that everything ran according to plan. Unfortunately I'm not seeing any of the output from my System.out.println commands. Here's the code:



Does anyone see what's going on here? I've verified the path for the fileName variable, so I'm pretty sure I'm good there. I'd debug it, but when I set a breakpoint, it doesn't get far enough to check for the values of my variables.

Thanks for the help!

Justin
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jw Riggs wrote:I'm as green as they come, so be gentle...

I'm trying to capture some MIDI events and throw them into an ArrayList so that our other program can then iterate through them and display the notes using Batik. I have the following code, but when I run or debug it, I just get the following message:

<terminated, exit value: 0>C:\Program Files\Java\jre7\bin\javaw.exe (Sep 5, 2013, 1:51:50 PM)

which, from what I can gather, means that everything ran according to plan. Unfortunately I'm not seeing any of the output from my System.out.println commands. Here's the code:


Does anyone see what's going on here? I've verified the path for the fileName variable, so I'm pretty sure I'm good there. I'd debug it, but when I set a breakpoint, it doesn't get far enough to check for the values of my variables.

Thanks for the help!

Justin



All the System.out.println() calls are wrapped in a conditional, using the DO_PRINT variable. And the boolean variable is set to false.

Henry
 
Jw Riggs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
All the System.out.println() calls are wrapped in a conditional, using the DO_PRINT variable. And the boolean variable is set to false.


Thanks Henry,

Changed the value to true, and am still getting nothing but the <terminated> message in the console when I run or debug...
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jw Riggs wrote:
Changed the value to true, and am still getting nothing but the <terminated> message in the console when I run or debug...


Did you try to run this from the command line instead? This way, you can tell if it is a problem with the java program, or the code that is calling your java program.

Henry
 
Jw Riggs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Jw Riggs wrote:
Changed the value to true, and am still getting nothing but the <terminated> message in the console when I run or debug...


Did you try to run this from the command line instead? This way, you can tell if it is a problem with the java program, or the code that is calling your java program.

Henry


Well, I fixed the issue. Like I said, I'm brand new to this, so I'm not sure I can explain why what I did worked, but here's the gist of it. While playing around I saw a tooltip that said that MIDILoader was the name of a constructor. I googled how to call an instance of a constructor in the main class, and did that. Suddenly, *poof*, everything worked. Here's the code:



Now I'm working on outputting the values I see from the println command to a text file. I have the right code to do it (the files are being generated and a single value is in the file), but I'm obviously not putting it in the right part of the loop. If I can't figure that out, I suppose I'll start a new topic; I just hate to ask such simple questions. Makes me feel, well, sloooooow...

Thanks for your help!!
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jw Riggs wrote:Well, I fixed the issue. Like I said, I'm brand new to this, so I'm not sure I can explain why what I did worked...

And I suspect that the reason for that is that you've written so much code.
I can't remember the last time I wrote a method that was more than about 30 lines, except when I was writing Swing code.

My advice: StopCoding (←click) and rationalise some of the main steps of that wall of code into methods.
You'll thank me later.

Oh, and it's probably way too late now, but please DontWriteLongLines. It makes your thread very hard to follow;
and it's actually a very bad coding habit to get into.

Winston
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!