[ 
https://issues.apache.org/jira/browse/NETBEANS-5961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17406302#comment-17406302
 ] 

David Green commented on NETBEANS-5961:
---------------------------------------

Could be but the entire output window is shown below.

It is a new project printbug2 because I made a change to the original one
for another discussion and so I have rebuilt it to have an "as made by
NetBeans 12.4" version.

Note that the commands being output suggests that the maven in use is
packaged with NetBeans.  It seems to be *Apache Maven 3.6.3. *I do have
Apache Maven 3.8.1 version installed through brew on the command line path.

(The other reply in dev mailing list suggested using exec:java instead of
exec:exec which does seem to work but it is not the default behavior and I
don't yet understand if there are any negative implications).  I am trying
to keep it straight forward for beginning students.)

—-—-

cd /Users/dgreen/NetBeansProjects/printbug2;
JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-15.jdk/Contents/Home
"/Applications/NetBeans/Apache NetBeans
12.4.app/Contents/Resources/NetBeans/netbeans/java/maven/bin/mvn"
-Dexec.vmArgs= "-Dexec.args=${exec.vmArgs} -classpath %classpath
${exec.mainClass} ${exec.appArgs}" -Dexec.appArgs=
-Dexec.mainClass=dgreen.printbug2.NewMain
-Dexec.executable=/Library/Java/JavaVirtualMachines/zulu-15.jdk/Contents/Home/bin/java
process-classes org.codehaus.mojo:exec-maven-plugin:3.0.0:exec
Scanning for projects...

----------------------< edu.uab.dgreen:printbug2 >----------------------
Building printbug2 1.0-SNAPSHOT
--------------------------------[ jar ]---------------------------------

--- maven-resources-plugin:2.6:resources (default-resources) @ printbug2 ---
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory
/Users/dgreen/NetBeansProjects/printbug2/src/main/resources

--- maven-compiler-plugin:3.1:compile (default-compile) @ printbug2 ---
Changes detected - recompiling the module!
Compiling 1 source file to
/Users/dgreen/NetBeansProjects/printbug2/target/classes

--- exec-maven-plugin:3.0.0:exec (default-cli) @ printbug2 ---

Enter your name: Hi
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time:  12.457 s
Finished at: 2021-08-28T15:23:25-05:00
------------------------------------------------------------------------

On Sat, Aug 28, 2021 at 3:00 PM Geertjan Wielenga (Jira) <j...@apache.org>



> System.out.print buffered to Output Window
> ------------------------------------------
>
>                 Key: NETBEANS-5961
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-5961
>             Project: NetBeans
>          Issue Type: Bug
>    Affects Versions: 12.4, 12.5
>         Environment: JDK 15
> macOS 11.5.2
>            Reporter: David Green
>            Priority: Major
>
> In NetBeans 12.4 and verified to also behave this way on NetBeans 12.5-beta2, 
> System.out.print is buffered such that it does not show up in the NetBeans 
> Output window until a System.out.println (or probably things like program 
> end, and some buffer full scenario).
>  
> Example code: 
>  
> {{package dgreen.printbug;}}
> {{import java.util.Scanner;}}
> {{/**}}
> {{ * Demo program showing that System.out.print's are not pushed to output 
> window until a}}
> {{ * System.out.println}}
> {{ */}}
> {{public class NewMain {}}
> {{  public static void main(String[] args) {}}
> {{    Scanner sc = new Scanner(System.in);}}
> {{    System.out.print("Enter your name: ");}}
> {{    System.out.flush(); // should not be necessary but does not work 
> either}}
> {{    String name = sc.nextLine();}}
> {{    System.out.println("Hi " + name);}}
> {{  }}}
> {{}}}
>  
> —-
> {{Running it after Clean & Build (or before)}}
> {{ }}
> {{--- exec-maven-plugin:3.0.0:exec (default-cli) @ printbug ---}}
> {{dave}}
> {{Enter your name: Hi dave}}
> ------------------------------------------------------------------------
> BUILD SUCCESS
>  
> where "dave" was typed in without the benefit of seeing the prompt.
>  
> This works fine when run from true command line either inside a NetBeans 
> Terminal Window or the real command line.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to