• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compileing with .jar file

 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone explain to me how to compile or whether it is possible instead of import com.vertex....etc;

thanks,
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll always need the "import" whether you use JAR files or not.
 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, do i need to extract .jar for compiling the source if .jar contains a classes.

thanks a lot,
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, just inlude the JAR in your classpath.
For example javac -cp c:/myjars/bob.jar;. Hello.java
 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, -cp =-classpath
 
Eung maeng
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
How do I define multiple .jar for compile?

thanks a lot,
 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
semicolon ; separated path for Windows
Use colon : for unix
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pau, sorry for the wrong compiler argument.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic