I’m trying to run the “BugRunner” Java3D program from the Killer Game Programming in Java book by O’Reilly (yes, I bought the book) and using
java BugRunner
does NOT work from a .bat file. I am wondering if anyone can tell me why/what to do to get it working. I assume this is a fairly easy fix. This is the first time I’ve ever used Java3D. There are errors and a paragraph of text in Command Prompt, but this only occurs when I run it like this. I don’t have this issue when running it in an IDE like BlueJ.
I do not have the book here for reference and I did not use Java3D before, but from what I understand you have a bat-file and in that file you try to run the “java BugRunner” command? When you run the command in the IDE directly it works, correct?
I am really not knowledgeable on programming on Windows, but my guess would be that when you execute the bat-file that it does not have the path to java and the file with the BugRunner code. You know how Windows (and Linux for that matter) keep a variable where to search for the binaries of the commands you want to run. Like when you run java in the Powershell it will search the path to see where the binary is and my guess here would be that it maybe either does not find the java binary or the code file you want to run.
But still, this is a wild guess and I have no experience with Windows in this regard. I can also not try myself anytime soon since I will be busy over Christmas, sorry.
I think @H-i-v-e is correct - maybe you haven’t compiled the code? javac <filename>.java compiles it and creates the .class file(s) that you need to point the java command at.
Please post the error - otherwise we’re just guessing…