Which is the Best Java Web Framework ?

Java - Interview Questions and Answers on Path and ClassPath

Q1.  How to display and set the Class path in Unix ?

Ans. To display the current CLASSPATH variable, use these commands in UNIX (Bourne shell):

% echo $CLASSPATH

To delete the current contents of the CLASSPATH variable, 

In UNIX:      % unset CLASSPATH; export CLASSPATH

To set the CLASSPATH variable, 

In UNIX:      % CLASSPATH=/home/george/java/classes; export CLASSPATH


Q2.  What environment variables do I need to set on my machine in order to be able to run Java programs?


Ans. CLASSPATH and PATH are the two variables.


Q3.  Difference between PATH and CLASSPATH ?

Ans. PATH is the variable that holds the directories for the OS to look for executables. CLASSPATH is the variable that holds the directories for JVM to look for .class files ( Byte Code ).





Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
comments powered by Disqus




×

Try our new Java Interview Questions Search Tool.

There are more than 1000 questions with practice tests.

It's updated daily and It's Awesome.


×

Try our new Java Practice Test tool.

There are more than 200 questions and expanding quickly. It's updated daily and It's Awesome.