I am getting below error when i am trying to set classpath. I am using CentyOS. I am trying to complie a java file in command prompt for that i am setting the classpath. On executing the same java program in Intellij , it runs fine. On executing the same from command prompt it shows error for missing jars so for that i added the classpath to that lib on which the error is seen.
[root@a admin]# export CLASSPATH=/home/admin/TagAPI/lib/org.json-20120521.jar ;/home/admin/TagAPI/lib/testng-6.8.21.jar
invalid file (bad magic number): Exec format error
Any suggestions will be helpful. I am new in both java and linux, thanks!!
In unix environment the delimiter for classpath is :
so change it to:
export CLASSPATH=/home/admin/TagAPI/lib/org.json-20120521.jar:/home/admin/TagAPI/lib/testng-6.8.21.jar
;
is the command delimiter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With