| Author |
compileing with .jar file
|
Eung maeng
Ranch Hand
Joined: Feb 10, 2002
Posts: 68
|
|
Does anyone explain to me how to compile or whether it is possible instead of import com.vertex....etc; thanks,
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
|
You'll always need the "import" whether you use JAR files or not.
|
[My Blog]
All roads lead to JavaRanch
|
 |
Eung maeng
Ranch Hand
Joined: Feb 10, 2002
Posts: 68
|
|
thanks, do i need to extract .jar for compiling the source if .jar contains a classes. thanks a lot,
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
No, just inlude the JAR in your classpath. For example javac -cp c:/myjars/bob.jar;. Hello.java
|
 |
Eung maeng
Ranch Hand
Joined: Feb 10, 2002
Posts: 68
|
|
thanks, I tried to compile a source on dos prompt with your command like javac -cp.... -CP option is not valid for compiler. anotherone, e.g, a test.java source is in c:\APP\PGM\ and import B.UTIL.Iaddress; import B.UTIL.Ilookup; .... jar is in c:\lib\utility.jar what contains for Iaddress and Ilookup etc.. In this case, where I need to compile and how , what I have to do for compile. Please let me know if it's not good exampe for your answer. Regards,
|
 |
Roseanne Zhang
Ranch Hand
Joined: Nov 14, 2000
Posts: 1953
|
posted

0
|
use -cp for java command is fine However, you must spell it out -classpath for javac command Who knows why? But we have to follow it. here is the official help from the commands
|
 |
Eung maeng
Ranch Hand
Joined: Feb 10, 2002
Posts: 68
|
|
|
thanks, -cp =-classpath
|
 |
Eung maeng
Ranch Hand
Joined: Feb 10, 2002
Posts: 68
|
|
hi, How do I define multiple .jar for compile? thanks a lot,
|
 |
Roseanne Zhang
Ranch Hand
Joined: Nov 14, 2000
Posts: 1953
|
posted

0
|
semicolon ; separated path for Windows Use colon : for unix
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
|
Pau, sorry for the wrong compiler argument.
|
 |
 |
|
|
subject: compileing with .jar file
|
|
|