views:

33

answers:

2

Hey.

I am trying to use the Apache Java library SystemUtils to determine the operating system being used. Here is a link:

http://commons.apache.org/lang/api-2.4/org/apache/commons/lang/SystemUtils.html

I am using netbeans to create my application. I can not figure out how to use the library. I have tried importing it but it does not seem to be installed. I have tried finding a download and adding that but I am unable to find one.

Could someone please give me some advice on how to get this library working using netbeans?

Cheers

Eef

+2  A: 
  1. Download the commons-lang-2.5-bin.zip

  2. Extract it, and find the commons-lang-2.5.jar

  3. Add that jar to the classpath of your project by:

    right click your project > Properties > Libraries > Add Jar/Folder

Bozho
That works, Cheers mate!
Eef
A: 

Instructions for Netbeans 6.7. It should not be too different in other versions.

  1. Select your project
  2. Open Run > Set Project Configuration > Customize...
  3. In Categories, select Libraries
  4. In the Compile tab, click on Add JAR/Folder...
  5. Select the commons-lang JAR.

If you are using Maven, just include the commons-lang dependency in the <dependencies> section of your pom.xml:

<dependency>
    <groupId>commons-lang</groupId>
    <artifactId>commons-lang</artifactId>
    <version>2.4</version>
</dependency>
gpeche