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


Please Help Members By Posting Answers For Below Questions

Is string a wrapper class?

512


Why do you canvas?

608


What is the difference between array and array list in java?

603


What is difference between filereader and bufferedreader?

527


How do you control extraneous variables?

501






Explain the difference between map and flatmap stream operation?

814


23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an tag?. code,height & width. 26. What does 'CODEBASE' in an applet tag specify?. Files absolute path.

2050


when you will synchronize a piece of your code? : Java thread

527


What are the library functions in java?

544


If try block is successfully executed, Then Is Finally block executed?

606


How many static init can you have?

676


How many bits is a float?

539


What do you mean by Hash Map and Hash Table?

596


What is the difference between the size and capacity of a vector?

565


What is an immutable object? How do you create one in java?

598