views:

35

answers:

2

I recently installed java 3D in my computer and it all the progras which I created worked from the NetBeans IDE. However when i set the path in the command line, it says that javac is not ercognised. I set the path to, C:\Program Files\Java\Java3D\1.5.1\bin

and then typed javac FirstProgram.java I got the following mesage (please help)

'javac' is not recognized as an internal or external command, operable program or batch file.

A: 

If you have compiled your project in NetBeans already, then to run it you use java not javac.

If you can export your built project as a JAR (would be in dist folder of your project), you can run it with java -jar myProgram.jar

javac is the Java compiler, should be where you have put the JDK, not Java 3D.

Bakkal
A: 

Setting the path to Java3D won't help you much. It's important that the Java3D jars (you can find them if you look around the stuff in that directory) are on your classpath when you execute your program. So to augment Bakkal's suggestion, you need something like

java -cp "C:\Program files\Java\Java3d\lib\xxx.jar" -jar myProgram.jar

The path to your 3D jar is in quotes because of the usual trouble with blanks in a directory name. This is one of Microsoft's most stupid mistakes!

Carl Smotricz