How to set mail.jar(JavaMail) and mysql-connector-java.jar in Linux class path
Hi,
Hope you all are at good health.I want to ask how i set Linux class path for mail.jar and mysql-connector.jar. I have set the class path for java with the command. Code:
export JAVA_HOME="/usr/java/jdk1.6.0_14;" Also if i want to know that what shell i am using how can i find it.Also what is the command for showing class path variables or how can i see my JAVA_HOME class path.Means after setting the class path for above two files how can i see that these files have added. When i write echo $CLASSPATH or echo $JAVA_HOME it shows nothing no error but again shows the prompt. One thing more i want to run a java program on Linux it is in a package (named asteriskproject). It consist of 10 java files. I have run this program on windows using netbeans IDE.For this program i need to set my Linux class path for the above mentioned files, and this is my first time that i am running any program on Linux. So i want to ask how can i run my program. Simply put this asteriskproject directory in any folder and run the main file using javac. Is it right way to run the program that consist of package ? Thank you. |
I followed this type of class path ..
$vi .bashrc JAVA_HOME= /usr/lib/jvm/jre export PATH=$JAVA_HOME:$PATH |
If you have .jar file you can follow this.
compiling: Code:
javac -classpath <full_path_to_jar_file>.jar:. <file_containing_main_method>.java Code:
java -classpath <full_path_to_jar_file>.jar:. <file_containing_main_method> |
I for got one instruction, when you are executing above commands, you must be in the directory of "file containing main method". You must have write permissions to that folder.
|
All times are GMT -5. The time now is 03:06 AM. |