cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

JLINK - where does system.out.println go?

lylebeidler
1-Newbie

JLINK - where does system.out.println go?



Ok, I'm sure I know this one, but the cold medicine is messing with my head
this morning: where does JLink put the output of a system.out.println
command? I've checked the trail file, nothing. The application's log file
- nothing. I'm at my wit's end.

Thans.



--



Lyle Beidler
MGS Inc
178 Muddy Creek Church Rd
Denver PA 17517
717-336-7528
Fax 717-336-0514
<">mailto:-> -
<">http://www.mgsincorporated.com>
4 REPLIES 4

Lyle -

Did you look for the file named std.out in Pro/Engineer's active
directory?
I have also noticed that it's unclear where a Pro/Toolkit application's
standard output and standard error streams write to.

I'm assuming that your system.out.println statements are not part of the
final application, but rather code you put in for the sake of debugging
your code. If that's right, have you considered using your IDE's
debugger?
Look for the "Java Options and Debugging" page in the JLink API Wizard.

If you're not using an IDE, I suggest you spend some time installing
Eclipse or NetBeans. Both are excellent and free.

|+| M a r k |+|

Mark Stallard
Engineering Information Management
Integrated Solutions & Development
Integrated Defense Systems
Raytheon Company



(business)
+1.978.436.6016
(cell)
+1.617.331.5443
(tie line)
239.6016
-

880 Technology Drive
Billerica, MA 01821
www.raytheon.com


This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this
message in error, please so advise the sender by reply e-mail and delete
this message. Thank you for your cooperation.





bfrandsen
6-Contributor
(To:lylebeidler)

You can define where to put the standard output.
I have these two lines of code in the very first J-Link application that
is started. In my case the one, that adds the J-Link menus. All other
J-Link application will inherit this definition.

System.setOut(new PrintStream(new FileOutputStream(
"d:\protrail\jlink_system_out.txt")));
System.setErr(new PrintStream(new FileOutputStream(
"d:\protrail\jlink_system_err.txt")));

As Mark mentioned, using a debugger can be useful as well. To set up the
debugger in Eclipse do this:

Set this in your config.pro:
jlink_java_command java -Xnoagent -Xdebug
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n

In Eclipse:
Select the appropriate project in the Package Explorer
Select the menu Run > Debug Configurations...
RMB Remote Java Application in the Type tree and select New
Within the Connect Tab accept the default for Connection Type: Standard
(Socket Attach)
Leave the Host set to "localhost"
Use the default Port: 8000
When debugging, start Pro/ENGINEER, start the debugger and run the J-Link
application.
Regards,
Bjarne



Lyle Beidler <->
10-11-2009 16:33
Please respond to
Lyle Beidler <->


To
-
cc

Subject
[proecus] - RE: JLINK - where does system.out.println go?







Ok, I?m sure I know this one, but the cold medicine is messing with my
head this morning: where does JLink put the output of a system.out.println
command? I?ve checked the trail file, nothing. The application?s log
file ? nothing. I?m at my wit?s end.
Thans.

--

Lyle Beidler
MGS Inc
178 Muddy Creek Church Rd
Denver PA 17517
717-336-7528
Fax 717-336-0514
-



> where does JLink put the output of a system.out.println command?

Approaching the question from another direction ...

Since you really don't know what crazy stuff the user is going to
throw at your application, a logging API can be useful. This is
especially true when it comes to diagnosing problems you couldn't
have predicted.

log4j is a commonly used logging API for Java applications, but
sometimes you just need a FileWriter. As an alternative, you can
log to the Pro/Engineer trail file.



Marc
--
Marc Mettes
-
Visit My CAD/PDM AutomationBlog
Or, Subscribe to My CAD/PDM Automation Blog by Email





Hello Lyle


If you are using an Async application in eclipse or some other IDE then the system.out.printlin will be displayed in the console window within the IDE. If you are using a sync application then I would use the JOptionPane or use the method that is in WF4 named sesssion.UIShowMessageDialog("text") to review your errors or messages.

If you have any questions please contact me at jfelkins@felcosolutions.com. Hope this helps.

In Reply to Lyle Beidler:



Ok, I'm sure I know this one, but the cold medicine is messing with my head
this morning: where does JLink put the output of a system.out.println
command? I've checked the trail file, nothing. The application's log file
- nothing. I'm at my wit's end.

Thans.



--



Lyle Beidler
MGS Inc
178 Muddy Creek Church Rd
Denver PA 17517
717-336-7528
Fax 717-336-0514
< -
< http://www.mgsincorporated.com



Top Tags