• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Include other jar files in project

 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I think this is a rather simple question but I can get it right.
I need to include antoher jar file in my projects so that when a user downloads my jar no classpath needs to be set. There are altso properties files that a user needs to edit but they must reside outside the jars.

// Mathias
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by 'include' and 'projects'?
 
Sidd Kulk
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From your query, it seems that you want the user to be able to download your jar file, using some protocol. I don't think you need to do anything, you can just set the content type of your JSP as jar. I am not sure, but it should work.

It would be helpful for us if you can elaborate as to exactly what you are trying to do.

Njoy!!
Sid
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have compiled a jar file with my classes. It import classes from another jar.
How can I make it one clickable jar file for distribution without making a lot of bat files or sh files?

And most important, without messing with user classpath?
[ April 19, 2007: Message edited by: Mathias Nilsson ]
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it need to be one jar file? The manifest of a jar file can declare a classpath that includes other jar files. So if you distributed a zip file that unzips to a directory full of jars, everything should work nicely. You could even include the main class in all the jars, thus ensuring that it doesn't matter which jar file is double-clicked.
 
Mathias Nilsson
Ranch Hand
Posts: 367
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok I there any short example on how to do this?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15448
42
Android IntelliJ IDE Java Scala Spring
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic