asebak / embeddedlinux-jvmdebugger-intellij

Embedded Linux JVM Debugger for Raspberry Pi for IDEA Platform
Apache License 2.0
55 stars 21 forks source link

Command line application on Raspberry #66

Open lgLindstrom opened 8 years ago

lgLindstrom commented 8 years ago

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

BartoszKaszewczuk commented 7 years ago

+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?

asebak commented 7 years ago

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

BartoszKaszewczuk commented 7 years ago

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

BartoszKaszewczuk commented 7 years ago

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

emilm commented 7 years ago

Any progress on this? :)

asebak commented 7 years ago

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

jugendhacker commented 6 years ago

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