Skip to main content
1-Visitor
May 15, 2020
Solved

how to print output on Terminal instead of MethodServer from Java class?

  • May 15, 2020
  • 1 reply
  • 4073 views

HI, I am executing a java class from terminal in windchill environment. If I use System.out.println("Print this "); method , output gets printed in methodserver log file. I want this output to be printed on Terminal from which I executed my java file. How any I achieve this?

Best answer by BjoernRueegg
public static void printMessageToConsole(String message) {
MethodContext methodContext = MethodContext.getContext();
methodContext.sendFeedback(new StatusFeedback(message));
}

1 reply

17-Peridot
May 15, 2020
public static void printMessageToConsole(String message) {
MethodContext methodContext = MethodContext.getContext();
methodContext.sendFeedback(new StatusFeedback(message));
}
1-Visitor
May 15, 2020

Thank you @BjoernRueegg  This is working.