This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript 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
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

<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: 23883
142
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: 23883
142
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: 10777
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
 
Think of how dumb the average person is. Mathematically, half of them are EVEN DUMBER. Smart tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic