Recent

Author Topic: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!  (Read 8830 times)

mark332

  • Newbie
  • Posts: 3
[SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« on: November 07, 2013, 02:49:59 pm »
I'm currently writing a program, wich should use TProcess to execute a java-Console in the Background and print its output into a Memo,

My Problem is, that the output of the .jar, wich is being executed by java
(wich is being executed by my Program)
Just goes to the java-console, not to the Pipe, where the java-console should stream its output,
so the memo just stays blank :/

If I don't give TProcess the option poUsePipes, I can read and see the output in the java-console.

If I start java indirect with a batchfile and execute an batchcommand before I start java, I can read the batchfiles output inside my memo, but from the place, where java is being executed, the output stops printing itself in the memo :$

Little "grafic"
http://hastebin.com/lecarufede.coffee
(german, but I think it's readable)

My first post to this topic at lazarusforum.de:
http://www.lazarusforum.de/viewtopic.php?f=55&t=7307&p=65278#p65278
(German, too. But you can find the used code there)

I hope the international lazarus-community can help me in solving this problem :)

mark332

PS: If you find mistakes in my english, please tell me :)
I'm german and still learning :P
« Last Edit: November 07, 2013, 05:39:56 pm by mark332 »

sam707

  • Guest
Re: TProcess + Java | Output isn't using poUsePipes ?!
« Reply #1 on: November 07, 2013, 04:08:58 pm »
I don't use java, I did and do never want to, because they use a PCode concept pseudocompiled code that runs on a Virtual Machine. The concept (even if java always claimed it was new and the future) is old like hell and was already used in Fortran 77 (1977).

But I guess that IF java PCode is embeded in a Virtual java Machine, they might have their own 'soup' to redirect the standard I/O. In such case, I am sorry to tell you that you will find no solution to your problem... Or maybe by getting their WM source code and modify it at your own risks and rights
« Last Edit: November 07, 2013, 04:23:44 pm by sam707 »

mark332

  • Newbie
  • Posts: 3
Re: TProcess + Java | Output isn't using poUsePipes ?!
« Reply #2 on: November 07, 2013, 05:39:44 pm »
Nevermind, the mistake is in the .jar File,

The standart Output was in the ErrorOutput, so poStderrToOutPut fixed it ;)

BertVerhees

  • New Member
  • *
  • Posts: 17
Re: TProcess + Java | Output isn't using poUsePipes ?!
« Reply #3 on: October 19, 2014, 04:44:43 pm »
I don't use java, I did and do never want to, because they use a PCode concept pseudocompiled code that runs on a Virtual Machine. The concept (even if java always claimed it was new and the future) is old like hell and was already used in Fortran 77 (1977).

But I guess that IF java PCode is embeded in a Virtual java Machine, they might have their own 'soup' to redirect the standard I/O. In such case, I am sorry to tell you that you will find no solution to your problem... Or maybe by getting their WM source code and modify it at your own risks and rights

Narcissism and useless!!!!
People reading this discussion are not interested in your opinions about Java, they read it to find an answer.

The answer is to give these options to TProcesss

AProcess.Options := AProcess.Options + [poWaitOnExit, poNoConsole, poStderrToOutPut, poUsePipes];
« Last Edit: October 19, 2014, 05:03:44 pm by BertVerhees »

eny

  • Hero Member
  • *****
  • Posts: 1634
Re: TProcess + Java | Output isn't using poUsePipes ?!
« Reply #4 on: October 19, 2014, 05:23:53 pm »
Narcissism and useless!!!!
People reading this discussion are not interested in your opinions about Java, they read it to find an answer.
http://en.wikipedia.org/wiki/The_pot_calling_the_kettle_black
All posts based on: Win10 (Win64); Lazarus 2.0.10 'stable' (x64) unless specified otherwise...

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« Reply #5 on: October 19, 2014, 05:40:21 pm »
Did sam707 upset someone recently that the person decided to:
1-Create and account.
2-Dig a post from 2013.
3-Post a "criticism".

O:-)

BertVerhees

  • New Member
  • *
  • Posts: 17
Re: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« Reply #6 on: October 20, 2014, 03:47:09 pm »
Did sam707 upset someone recently that the person decided to:
1-Create and account.
2-Dig a post from 2013.
3-Post a "criticism".

O:-)
Yes I did. I was searching for an answer on that question and I got bored by someone needing to give a useless answer.

Seems all rather obvious to me.

Anyway, that was my good deed for the day. I hope sam707 will learn his lesson instead of providing off topic lessons.

sam707

  • Guest
Re: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« Reply #7 on: October 20, 2014, 05:15:14 pm »
sure i am born to upset the world :D

its okay, feel free to judge me at your level! and I accept gently! BUT please be careful, that gives me the rights to judge you at my level THEN , naturally!  :D
« Last Edit: October 20, 2014, 05:17:45 pm by sam707 »

sam707

  • Guest
Re: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« Reply #8 on: October 20, 2014, 05:23:00 pm »
hmm you can look at ALL my posts, u will never find a personnal judgement from me before it started on my person.. I emited and emit opinions on software and orientations, i am apparently less mean than you want me to be... please expect that it wont change and that I wont be childish or idiot enough to play your personnal destructive game ;) critics are constructive, judgements are destructive :D READY? SURE?

most of the time i prefer to mute , i have a cool proverb/saying for such situations "I let the dogs barking and I continue my journey" hahahaha ask qdos ;)

ok i am a little bit smartass, but i aint mean like some of  you as i saw hahahah

take care
« Last Edit: October 20, 2014, 05:39:48 pm by sam707 »

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« Reply #9 on: October 20, 2014, 05:53:30 pm »
Anyway, that was my good deed for the day. I hope sam707 will learn his lesson instead of providing off topic lessons.
It sounds like a distorted meaning for "good deed". Anyway, I sincerely hope you are not getting obsessed with sam707. Please do not create another account to attack sam707.

Edit:
Someone with enough power, close this thread, please.

2nd Edit:
Deleted the quote.
« Last Edit: October 20, 2014, 06:09:51 pm by engkin »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11459
  • FPC developer.
Re: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« Reply #10 on: October 20, 2014, 06:04:05 pm »
According to our dear friend Aminer: "We have to be smart please". He said that while working on his great ParalellVarFiler.

Citing banned users may not set a good example  >:D

sam707

  • Guest
Re: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« Reply #11 on: October 20, 2014, 06:15:04 pm »
thank you Marcov ::)

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« Reply #12 on: October 20, 2014, 06:16:40 pm »
Citing banned users may not set a good example  >:D
Sorry, deleted it. ::)

BertVerhees

  • New Member
  • *
  • Posts: 17
Re: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« Reply #13 on: October 21, 2014, 08:58:30 am »
its okay, feel free to judge me at your level! and I accept gently! BUT please be careful, that gives me the rights to judge you at my level THEN , naturally!  :D

I don't judge you, I am just talking about one small thing you did. That is all. Don't exaggerate.

I am just not interested in how you feel about Java when the topic is how to get the commandline-output from a Java-program.
In my opinion, here was someone seeking help, and you bitched him off because you don't like Java.

The answer to his question was, in the end, quite simple, he found out himself, and hinted me finding it that way.
IMHO That is what forums are for, to help each other.

But, hypothetically, let's say that I am wrong. Your answer was not narcissistic or useless.
Please explain the usefulness of your answer in regard to the asked question or if not useful, please explain why you answered him at all.
I am very eager to learn from you.

I thank you and wish you have a nice day.
« Last Edit: October 21, 2014, 09:02:20 am by BertVerhees »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11459
  • FPC developer.
Re: [SOLVED] TProcess + Java | Output isn't using poUsePipes ?!
« Reply #14 on: October 21, 2014, 09:48:58 am »
Enough, since it won't die out, I'll lock it.

 

TinyPortal © 2005-2018