embeddedlinux-jvmdebugger-intellij icon indicating copy to clipboard operation
embeddedlinux-jvmdebugger-intellij copied to clipboard

Command line application on Raspberry

Open lgLindstrom opened this issue 8 years ago • 7 comments

I have a really simple example of a command line application that I can't get to work.

`public class CommandLine {

/**
 * @param args the command line arguments
 */
public static void main(String[] args) {
    String input = "";
    Scanner scanInput = new Scanner(System.in);
    boolean running = true;
   while (running)
   {
       System.out.println("Give data");

       input =  scanInput.nextLine();

       System.out.println(input);
   }
    System.out.println("Closing");
}     

}`

When running this application from Intellij IDE remote on a Raspberry "scanInput.nextLine" seems not to work. "System.out.println" works nicely putting text to the console window,, but there it ends. When I after receiving promt "Give data" inputs some texts it seems like the input goes to a the local windows shell instead of the application.

For me, mainly working with hardware development, the possibility to quickly write a simple application to test new hardware,, is very important.

Can anyone help me here, are I doing something wrong or is it not supposed to work ..?

//lg

lgLindstrom avatar Oct 06 '16 11:10 lgLindstrom

+1 Plugin seems to be passing keyboard input to bash shell rather than Java application. Is it support issue or a matter of configuration? @asebak could you comment on this?

BartoszKaszewczuk avatar Nov 11 '16 02:11 BartoszKaszewczuk

Yeah that's correct, this is a bug, I would need to check it out.

asebak avatar Nov 29 '16 12:11 asebak

It looks like inputs are passed to shell of local machine (where intelliJ is running).

BartoszKaszewczuk avatar Nov 30 '16 05:11 BartoszKaszewczuk

Running with Run as sudo checkbox ticked also produces error sudo: no tty present and no askpass program specified I assume the two are tied together.

BTW: Platform is macOS but I believe the issue should be reproducible on Linux instances

BartoszKaszewczuk avatar Dec 01 '16 17:12 BartoszKaszewczuk

Any progress on this? :)

emilm avatar Feb 22 '17 15:02 emilm

@emilm No progress yet, been pretty busy. It would be great if you guys can contribute fixes for it.

asebak avatar Feb 24 '17 01:02 asebak

I have the same error! @asebak when you say me where in the repo I can find it I would fix ist if I can

jugendhacker avatar Jan 22 '18 20:01 jugendhacker