Introduce inputs in exec node

Not sure what you are doing here.

Try this on your commandline:

cd Java/SalsaHoy && javac SalsaHoy.java && java SalsaHoy Mickey

I tried your command and this error comes out:

Command failed: cd Java/SalsaHoy && javac SalsaHoy.java && java SalsaHoy Mickey
Exception in thread "main" java.lang.NullPointerException
	at SalsaHoy.main(SalsaHoy.java:6)

Your java code does not work, because you don't work with arguments, but with keyboard input from the console.

I am not familiar with java, something like this is what you should be using instead:

	class SalsaHoy{    
		public static void main(String args[]){    
		System.out.println("Welcome "+args[0]);    
		}    
	}

Your Java code is trying to read from the console. It needs to expect data in the command line instead.

YESS!! IT WORKED!! Thank you so much, I'm not familiar with Java so I didn't realize that. Thank you so much!

If you are not familiar with Java then why are you trying to use it instead of doing it all in node-red?

1 Like

Itā€™s doing exactly what you are telling it to do which means args[0] does not equal ā€œWeekendā€

I also do not know java since node-red is JavaScript. What I would suggest is you print out what args[0] to see what it is and more importantly go take a java tutorial or two before you go any further with this project.