Question:
why I can not run java program -using command line input?
2009-03-14 02:49:30 UTC
1) I download java from
http://www.java.com/en/download/index.jsp
2) but there is nothing in the java\java1.6.0-12 \bin dir
3)javac filename.java do not work
( and the java(TM) 6 update 12 is about 90MB)
Three answers:
skaterboy_yasar
2009-03-14 03:11:53 UTC
After you install java , you need to set the path where the bin directory is placed ..



for example if you installed java in c:\program files\java\bin\



then you have to add this to your environmental variables ..



how to do it ??



right click on your my computer , select properties , select advanced tab , select enveronmental variables , click new ..



variable name : java

variable value : your bin directory location ;



example : variable value : c:\program files\java\bin\



hopefully this should work ..



regards ..

AHY ..
Blackcompe
2009-03-14 06:10:39 UTC
That is to the JRE download, which is the runtime and is used to deploy java applications, not create them. You need the JDK.



http://java.sun.com/javase/downloads/index.jsp



Then you have the set the PATH , not CLASSPATH (confusing to some) under Windows Environment Variables to



C:\Program Files\Java\jdk1.6.0_06\bin



Thats where the installation should be found. Then you can compile from the CLI.
?
2016-10-31 15:56:54 UTC
in case you have JDK a million.6 or later, it relatively is basic. jar cfe growth.jar growth growth.classification In "cfe" the "c" says create an archive, "f" says shop in a record (named from the subsequent argument "growth.jar"), and the "e" (for "get right of entry to element") instruments the main significant classname to the subsequent argument after than ("growth"). Following those arguments is a itemizing of sophistication documents to incorporate interior the jar. for that reason, it relatively is in basic terms "growth.classification". you additionally could make a shortcut in homestead windows that runs a java command on that classname. it relatively is advisable to try this for GUI apps you create making use of Swing to steer away from the "black window". do this via working "javaw" extremely of "java" because of the fact the command to launch the class. appropriate-click on the laptop (or in yet another folder the place you elect the shortcut to be), elect New>Shortcut. interior the communication, click Browse... and navigate to the folder with the class or jar record. click on the record, click okay to repeat the finished path into the area container. Press the homestead key or click on the front of the path call and insert "java " or "java -jar " in front to run with java as a classification or jar record. Prefix with "javaw " or "javaw -jar " to run a GUI app as a classification or jar record. in case your application is console based, undergo in recommendations that the console window will close and disappear as quickly because of the fact the main significant() functionality returns. in case you elect something to stay seen, you have put in a pause for keyboard enter (or a postpone, perhaps).


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...