I'm making a project that takes in data from the command line using the Scanner in the typical way. I am usually able to pipe from a text file or another device.

I switched out a lot of the code in the project to run with the LWJGL. In eclipse it works fine and the program reads things typed in the console. However, when I run it from the command line as a fat jar (using "java -jar project.jar") it does not receive and data piped into it or typed in the command line.

Does this have something to do with the structure of LWJGL displays or something similar? How can I successfully pipe data into my Jar?

Using JarSplice I have been able to make everything work as I would hope. As I need to put input into my program using the command prompt, I don't need to be able to click the icon to make it run, but rather use the command "java -jar program.jar"

So if I were to transfer my project to NetBeans (which could take a while) what would you suggest I look into so that the Jar will properly take in things from the console? I don't see much written about this subject currently and I'm not sure how to proceed.

I am 99% sure this is a problem relating to input and not something else. My previous project that takes in console input in and identical way (through the Scanner) acts as expected. The program in question (along with that OpenAL demo I linked to) will not accept console input.

The thing is that when I type things into the console I AM using new lines. If I type in multiple commands (separated by new lines) then each "command" is parroted back out to me separately when the program ends.

So how can I configure everything so things are accepted into the scanner with each new line?

This code isn't meant to be understandable for anyone but me, really, because this is a pet project. The point is that I'm doing many operations on many received strings, and I am splitting them using ',' for the purposes of parsing strings into useful data. This works fine when I'm not using the LWJGL

So hold on, you're trying to process multiple lines of input from the console using a scanner? I don't mean to be offensive, and I'm sorry if you already know this, but you know that once you hit enter after inputing commands in to the console, the data is stored in the string object and then is wiped so its ready to get the next set of data? So essentially unless you have the scanner on some sort of loop and you have a strong array, you can't process multiple lines in one go?

That's exactly right, this project is accepting lines from the scanner on an infinite loop, updating things in the program according to structured strings put into the console.

The actual use of this is to read data from a microsoft kinect. Once again, this is only a pet project, so I didn't want to get bogged down in confusing libraries.

I found a program online that outputs data from the kinect into lines on the command prompt. So for example, if two people are walking around a room, the output can look like this, where a new line is written every fraction of a second or so:

By piping this data into my Jar in the command line, I can very easily pipe all this data into my program.For example, I can do this like this in the command line:

1

NISimpleSkeleton.exe | java -jarproject.jar

where NISimpleSkeleton.exe is the program that outputs the data from the kinect into the command line. My JAR reads this data in real time and updates the program accordingly.

This method of organization works very well. The only problems came from when I changed the "engine" of this project to the LWJGL, at which point it stopped working for the simple reason that it stopped being able to accept the data from the command line.

That is how I am using the scanner, I hope that brings light to the issue.

Ignoring most of the tangents this discussion has already touched on.. can you post for me your "main" operation that launches your application. What I'm suspecting is you actually have a thread issue. In which the buffer for the console where your typing is working just fine.. but nothing will be processed from it till your game ends.

The problem here has nothing to do with your code at all. It is JarSplice's fault. When running the JAR that is spit out by JarSplice, you are actually running its launcher, which, now that I look at the code, does not forward its stdin stream to your program. I'll talk to kappa about fixing this bug.

The problem here has nothing to do with your code at all. It is JarSplice's fault. When running the JAR that is spit out by JarSplice, you are actually running its launcher, which, now that I look at the code, does not forward its stdin stream to your program. I'll talk to kappa about fixing this bug.

Ah yes! Why didn't I think of that? Previously, before I moved my project to LWJGL, I had no reason to use Jarsplice, so I didn't. I didn't even imagine that Jarsplice would be the source of this problem. Thanks for pointing this out, I'll now work on finding a way to launch my project without Jarsplice...

Ok, It's asking me for parameters, but I don't understand where exactly to put themShould I run it like this (if my jar is named Game.jar and I had eclipse export the libraries into the folder Game_lib

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org