Home Java Java-get-example Java Get Class path



Java Get Class path
Posted on: October 23, 2008 at 12:00 AM
In this section, you will learn how to get the class path. The method System.getProperties() determines the current system properties.

Java Get Class path

     

In this section, you will learn how to get the class path. The method System.getProperties() determines the current system properties. 

 

 

 

Here is the code:

mport java.util.Properties;

public class GetClassPath {
static Properties prop = System.getProperties();
public static void main(String[] args) {
 prop.setProperty("java.class.path", getClassPath());
  System.out.println("java.class.path now = " + getClassPath());
  }
  static String getClassPath() {
  return prop.getProperty("java.class.path"null);
  }
}

 

Output will be displayed as:

Download Source Code

 

Related Tags for Java Get Class path:
cclasspropertiespathiomethodgetsystemrmithisietolearneareilsectionpecurrentinrmasmntminminclesemmehowprogetpropertiessystiestermatisllpropereaarrtropessrenthstetermetermpropprmiono


More Tutorials from this section

Ask Questions?    Discuss: Java Get Class path  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.