what is the need to set path in java? how many ways to set
path in java? Explain breif?
Answer Posted / sadhi
We keep all "executable files"(like .exe files) and "batch
files"(like .bat) in path variable. And we keep all jar
files and class files in classpath variables.
So path is set according to the .exe files & .bat files And
classpath is set according to the .jar files & .class files.
Operating system tries to find .exe and .bat files in path
and JVM tries to find all classes in classpath.
set path is loading the environment variables with operating
system or javac.
setting the path in windows xp.
steps to set path for java:
1. go to ->my computer-> properties->advanced->
->environment variables.
2. in this window go to system variables and select -> new
3. now in variable write: classpath
4. write code as soon here in variable value:
;.;C:\Program Files\Java\jdk1.5.0\bin;
5. click ok and ok and ok
| Is This Answer Correct ? | 15 Yes | 2 No |
Post New Answer View All Answers
Is boolean a wrapper class in java?
Can we pass a primitive type by reference in java? How
What is the difference between checked exception and unchecked exception?
What is the purpose of interface?
Can a class have multiple superclasses?
How to call one constructor from the other constructor ?
Give the difference between the println method and sqrt method?
What happens when heap memory is full?
How do you remove duplicates from an array in java?
Can set contain duplicates?
Do you know how to reverse string in java?
Which is better stringbuilder or stringbuffer?
If goto and const is reserve words than why it is not work in java?
What are bind parameters?
If an application has multiple classes in it, is it okay to have a main method in more than one class?