This may be a general question, but I cannot add the path to the JAR file in UBUNTU. I have given below all the details that I know:
java is here: command o / p which java - /usr/bin/java
sudo vim /etc/bash.bashrc export CLASSPATH=$CLASSPATH:/downloads/aws-java-sdk-1.3.24/lib/aws-java-sdk-1.3.24.jar
ps: the download folder is located directly under the root
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:"
As you can see, I added the class path in bashrc, etc. / environment ... but still I get an error when I try to run S3Sample.java , which comes with awssdk for java.
when I compile a java file, I get the following errors:
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;
Now I clearly understand that the JAR file is not added to the class path, and therefore I am not getting an error. I also tried javac with the class path parameter, but it does not work :(
PS: JAVA home is configured correctly, as other java programs work correctly.
source share