Broken console in Maven project using Netbeans
- by Maciek Sawicki
Hi,
I have strange problem with my Neatens+Maven installation. This is the shortest code to reproduce the problem:
public class App
{
public static void main( String[] args )
{
// Create a scanner to read from keyboard
Scanner scanner = new Scanner (System.in);
Scanner s= new Scanner(System.in);
String param= s.next();
System.out.println(param);
}
}
When I'm running it as Maven Project inside Netbeans console seems to be broken. It just ignores my input. It's look like infinitive loop in System.out.println(param);.
However this project works fine when it's compiled as "Java Aplication" project. It also works O.K. if I build and run it from cmd.
System info:
Os: Vista
IDE: Netbeans 6.8
Maven: apache-maven-2.2.1
//edit
Built program (using mavean from Netbeans) works fine. I just can't test it using Net beans.
And I think I forgot to ask the question ;). So of course my first question is: how can I fix this problem?
And second is: Is it any workaround for this? For example configuring Netbeans to run external commend line app instead of using built in console.