classpath

hi,
I am trying to compile a temp.java file in command, I got an error which complain about java-mail.jar. since the code is using javamail. I put the java-mail.jar file into the classpath folder locally, then I am trying to recompile again. but I still got the same error.
Any inputs will be appreciated!

Thanks
chenjhuaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Radek BaranowskiFull-stack Java DeveloperCommented:
to indicate location of jar files referenced in your code you need to specify -extdirs option of javac
0
CEHJCommented:
I got an error which complain about java-mail.jar

http://technojeeves.com/index.php/aliasjava1/17-errors

Please post also the command you used
0
chenjhuaAuthor Commented:
Radek:
Can you give an example? what is -extdirs option mean?
0
Radek BaranowskiFull-stack Java DeveloperCommented:
Directory of D:\devtools\hibernate_tutorial\source\com\rb\hibernatebasic

2015-03-27  12:56    <DIR>          .
2015-03-27  12:56    <DIR>          ..
2015-03-26  17:13               726 Employee.class
2015-03-27  12:56               458 employee.hbm.xml
2015-03-26  17:13               525 Employee.java
2015-03-26  20:12               861 hibernate.cfg.xml
2015-05-12  16:09             1 259 StoreData.class
2015-03-26  16:48               716 StoreData.java
               6 File(s)          4 545 bytes

 Directory of D:\devtools\hibernate_tutorial\source\lib

2015-03-27  14:19    <DIR>          .
2015-03-27  14:19    <DIR>          ..
2015-03-26  19:41           443 432 antlr-2.7.6.jar
2015-03-26  19:41            16 777 asm-attrs.jar
2015-03-26  19:41            26 360 asm.jar
2015-03-26  19:41           608 376 c3p0-0.9.1.jar
2015-03-26  19:41           282 338 cglib-2.1.3.jar
2015-03-26  19:41           175 426 commons-collections-2.1.1.jar
2015-03-26  19:41            38 015 commons-logging-1.0.4.jar
2015-03-26  19:41           313 898 dom4j-1.6.1.jar
2015-03-26  19:41           208 048 ehcache-1.2.3.jar
2015-03-26  19:41            50 626 ejb3-persistence.jar
2015-03-26  19:41           363 736 hibernate-annotations.jar
2015-03-26  19:41            66 426 hibernate-commons-annotations.jar
2015-03-26  19:41            60 992 hibernate-validator.jar
2015-03-26  19:41         2 204 714 hibernate3.jar
2015-03-26  19:41             6 727 jdbc2_0-stdext.jar
2015-03-26  19:41             8 812 jta.jar
2015-03-26  19:41           350 627 log4j-1.2.11.jar
2014-02-15  01:42           540 852 mysql-connector-java-5.0.8-bin.jar
2015-03-26  19:41         1 010 806 xerces-2.6.2.jar
              19 File(s)      6 776 988 bytes

when I have dirtectory structure as above and I'm in source then then to successfully compile StoreData.java, where I use classes from hibernate library (located in lib), I need to use the following:

javac -extdirs d:\devtools\hibernate_tutorial\source\lib  -cp . com\rb\hibernatebasic\StoreData.java
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.