• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[solved] add external jar for windows command line compile

 
David Westbrook
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,

i prefer working on my java programs over windows command line, and i would like to add an external jar file so i can start writing some servlets. i've googled, but haven't found any walkthrough for something like this (which surprised me) - anyone happen to know good way to do this?

regards and thanks in advance.
[ January 02, 2009: Message edited by: David Westbrook ]
 
Kristofer Treutwein
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you simply want to compile or run apps from command line, you can just add the jars to the classpath:
win: javac -classpath c:\path1\ext1.jar;d:\path2\ext2.jar de\example\MyClass.java

When running a java application, you have to add the classes folder as well
win: java -classpath bin;c:\path1\ext1.jar;d:\path2\ext2.jar de.example.MyClass


Note that under *ux* OS not a semicolon( , but a colon( is used to separate classpath parts.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you mean something like this


Or are you asking where to get that servlet jar file? In that case, look here.
 
David Westbrook
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/javac.html

Found the answer here. Thnx for anyone who looked anyway
 
David Westbrook
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Ulf and Kristofer, that is pretty much what I ended up doing. Thank you for the help!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic