title: adding JAR class path in UBUNTU
body: <p>This is might be a common question but I am not able to add class path for a JAR file in UBUNTU. I have given below all the details I know:</p>
  
  <p>java is located here:
  the o/p of <code>which java</code> command is  - <code>/usr/bin/java</code></p>
  
  <pre><code>sudo vim /etc/bash.bashrc  
  export CLASSPATH=$CLASSPATH:/downloads/aws-java-sdk-1.3.24/lib/aws-java-sdk-1.3.24.jar
  </code></pre>
  
  <p>ps: downloads folder is directly under the root</p>
  
  <pre><code>sudo vim /etc/environment
  CLASSPATH="/usr/lib/jvm/jdk1.7.0/lib: /downloads/aws-java-sdk-1.3.24/lib/aws-java-sdk-1.3.24.jar:"
  </code></pre>
  
  <p>As you can see, I have added the class path in bashrc and etc/environment... but still I am getting an error while trying to run the <code>S3Sample.java</code> which comes with awssdk for java.</p>
  
  <p>when I compile the java file, I get the following errors:</p>
  
  <pre><code>ubuntu@domU-12-31-39-03-31-91:/downloads/aws-java-sdk-1.3.24/samples/AmazonS3$ javac S3Sample.java
  
  S3Sample.java:25: error: package com.amazonaws does not exist
  import com.amazonaws.AmazonClientException;
  </code></pre>
  
  <p>Now, I clearly understand that the JAR file is not added to the class path and so I am not getting the error. I've also tried <code>javac</code> with the class path option - but it does not work :(</p>
  
  <p>PS: JAVA home is set correctly as other java programs work properly.</p>