LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-14-2005, 11:52 PM   #1
omarbohsali
LQ Newbie
 
Registered: Oct 2004
Posts: 3

Rep: Reputation: 0
Reading Stdout into a Flatfile and Java Compiling Problems


I have a program that outputs a lot of data to the terminal and I need to load it into an array in java. What's the best way of doing this?

Thanks!!

Edit I was gonna post again but decided to consolidate it into one post: I have some code in java, it compiles perfectly in JCreator on Windows, but when I try and gcj it, I get weird stuff like this:

initial3d.java:54: parse error.
return dim;
^

and this:

initial3d.java:103: Invalid declaration.
StringBuffer length = new StringBuffer();

why is gcj trying to compile it differentley?

Last edited by omarbohsali; 01-14-2005 at 11:56 PM.
 
Old 01-16-2005, 06:24 AM   #2
obashir
LQ Newbie
 
Registered: Nov 2002
Location: Loughborough, UK
Distribution: Redhat 9, Fedora, Yellow Dog
Posts: 29

Rep: Reputation: 15
Hi,

Redirect the output of the other program into a text file and then use an appropriate java.io class to read that text file.
 
Old 01-16-2005, 07:24 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
why is gcj trying to compile it differentley?
It could be because gcj is not compliant with the version of Java your program is written to,
but the lines you post aren't enough to figure out what's going wrong.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is stdout stefaandk Linux - Newbie 1 09-06-2005 07:20 PM
stdout to file Machiaveli Programming 8 09-04-2005 08:53 AM
reading from stdout nodger Programming 2 02-24-2005 07:49 AM
stdout with tk? sk8guitar Programming 1 07-30-2003 02:48 PM
#@!?£$# stdout problem!! beedyrazzle Linux - Newbie 3 01-21-2003 08:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration