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?
 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.