asebak / embeddedlinux-jvmdebugger-intellij

Embedded Linux JVM Debugger for Raspberry Pi for IDEA Platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Command line application on Raspberry

lgLindstrom opened this issue · 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

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

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

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

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

Any progress on this? :)

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

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