This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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

 
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
 
author
Posts: 23834
140
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux 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
Posts: 23834
140
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux 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!!
 
Bartender
Posts: 10771
71
Hibernate Eclipse IDE 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!