Home Java Java-get-example Java Get Class path

Related Tutorials


 
 

Share on Google+Share on Google+

Java Get Class path

Advertisement
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

 

Advertisements

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: October 23, 2008

Related Tutorials

Discuss: Java Get Class path  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:0
DMCA.com