If my java is stored in C:\Documents and Settings\Welcome\workspace\transform\src\com\coderanch\jaxws\passxml and I would like to compile a file how can I do it??
Well, assuming the top of the hierarchy is the C:\Documents and Settings\Welcome\workspace\transform\src directory. And YourClass is in the com.coderanch.jaxws.passxml package. And you classpath is not set... then this would probably work best...
---> cd "\Documents and Settings\Welcome\workspace\transform\src"
---> javac com\coderanch\jaxws\passxml\YourClass.java
C:\Documents and Settings\Welcome\workspace\transform\src>javac -d . DomUtil.jav
a
'javac' is not recognized as an internal or external command,
operable program or batch file.
C:\Documents and Settings\Welcome\workspace\transform\src>
your path environmental variable is not properly set. You need to set the path as follows before you compile your code. I assume your jdk is installed as follows C:\Program Files\Java\jdk1.5.0_06, then before you compile your code type the following command prompt
set path=%path%;C:\Program Files\Java\jdk1.5.0_06\bin;.
the java path might change depending upon your installation.
now execute your code.
feda alshahwan wrote:Also I did the following but I got the following error
Did you do what Ankit told you to do?
Your OS has to know where to find the javac(ie the java compiler) and java (interpreter) to compile and run your commands.
If you are using windows, you need to set the environment variables or at least set the path as Ankit said.
I have already mentioned it in my last post. However that is for that particular session, once you close the command window its lost and you have to reset it.
If you wish to set it permanently following steps should help you
My Computer->Properties->Advanced->Environmental Variable
Now select path click edit
at end put a ; and paste the path of jdk\bin and put a ;.