vinoth sathiya wrote:HI,
Anybody tell me how to set classpath in Linux environment .
I tried in linux Terminal to set classpath using command export CLASSPATH = "/lib/mail.jar" .
But is it is throwing "Not a Valid identifier".
and also i will provide windows environment its working fine.
Window : java -Djava.security.policy=".\java.POLICY" -classpath ".\lib\mail.jar";".\lib\activation.jar"; mail.MailServer
Can anyone convert to linux environment.?
and after set the CLASSPATH in linux. How to check if path is set or not.
vinoth sathiya wrote:
Could you help?
Richard Tookey wrote:
vinoth sathiya wrote:
Could you help?
The implication is that your mail jar is not on your effective classpath or is not where your classpath indicates it to be BUT since you have not posted the command line being used to run the program I can't help further.
Ulf Dittmer wrote:What's the first colon doing there? Remove that. Also, do you really have a root directory "lib" where you keep jar files?
vinoth sathiya wrote:
Ulf Dittmer wrote:What's the first colon doing there? Remove that. Also, do you really have a root directory "lib" where you keep jar files?
Yes,
mail.jar and activation.jar are available in lib folder only
Richard Tookey wrote:
vinoth sathiya wrote:
Ulf Dittmer]What's the first colon doing there? Remove that. Also, do you really have a root directory "lib" where you keep jar files?
Yes,
mail.jar and activation.jar are available in lib folder only
I'm not convinced . Post the result of
ls -al /lib/*.jar
Also, I see nothing in your class path to indicate where your main class is being picked up from. Post the result of
ls -al *.jar
and
ls -al *.class
vinoth sathiya wrote:Hi,
Output of echo $CLASSPATH
:/lib/mail.jar:/lib/activation.jar
vinoth sathiya wrote:
[root@localhost mailpro]# ls -al /lib/*.jar
ls: cannot access /lib/*.jar: No such file or directory
[root@localhost mailpro]# ls -al /lib/*.jar
ls: cannot access /lib/*.jar: No such file or directory
[root@localhost mailpro]# ls -al *.jar
ls: cannot access *.jar: No such file or directory
[root@localhost mailpro]# ls -al *.class
ls: cannot access *.class: No such file or directory
[root@localhost mailpro]#
Ulf Dittmer wrote:So your classpath is wrong - you do not have a root directory called "lib". My guess is that "lib" is actually in your current directory - is that correct? If so, "ls lib" should show it, and CLASSPATH should be something like ".:lib/mail.jar:lib/activation.jar". Note the leading dot for picking up loose class files as well. The "mail" directory with the MailServer.class file in it also needs to be in your current directory
vinoth sathiya wrote:
i copied the two jars into mail directory and set the classpath (:mail/mail.jar:mail/activation.jar
After that executed mail.MailServer. still it throwing.
When i use ls -al /mail/*.jar
ls: cannot access /mail/*.jar: No such file or directory
Richard Tookey wrote:
vinoth sathiya wrote:
i copied the two jars into mail directory and set the classpath (:mail/mail.jar:mail/activation.jar
After that executed mail.MailServer. still it throwing.
When i use ls -al /mail/*.jar
ls: cannot access /mail/*.jar: No such file or directory
Do you mean the root directory /mail or the local directory ./mail (i.e. a directory called 'mail' in your current working directory? If you mean your current working directory then you need
ls -al mail/*.jar
and your class path should reference the mail directory in the current working directory and not the root directory /mail .
Ulf Dittmer wrote:Does "java -cp .:lib/*.jar mail.MailServer" work?
Ulf Dittmer wrote:No, the root of the class file hierarchy needs to be in the classpath, not any subdirectory of it.
Ulf Dittmer wrote:Does "java -cp .:lib/*.jar mail.MailServer" work?
This guy is skipping without a rope. At least, that's what this tiny ad said:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|