2

enter image description here

I have been asking a lot of questions about LTI-CIVIL and I have figured a solution. For that, I need to relative reference the native library for LTI. Is it possible to relative reference a library in Eclipse ?

If not, what is the workaround ?

An SO User
  • 24,612
  • 35
  • 133
  • 221

2 Answers2

1

Ok. This answer will work for you. I know you are not using ant, but you can still specify a CLASSPATH in the manifest of your jar. Include dot in the CLASSPATH, and put the LTI jar in the same folder. That means you can zip up your jar and the LTI jar together at the same outermost level.

If you want the directory structure of your other question, you can put ../putLTIhere in your CLASSPATH.

This answer will give you more details:

How to build a distributable jar with Ant for a java project having external jar dependencies

Community
  • 1
  • 1
Jess
  • 23,901
  • 21
  • 124
  • 145
  • I actually don't know. I know that if I relative reference the path to native library, I will be able to make my jar distributable – An SO User Mar 31 '13 at 02:18
  • read this: http://stackoverflow.com/questions/1089717/referencing-3rd-party-libraries-using-relative-paths-in-eclipse-cdt looks like I cannot relative reference anything :/ maybe I am wrong. – An SO User Mar 31 '13 at 02:26
  • You could use a CLASSPATH according to this. http://stackoverflow.com/questions/8277038/how-to-build-a-distributable-jar-with-ant-for-a-java-project-having-external-jar – Jess Mar 31 '13 at 02:30
  • Ok, this answer makes sense. Previously, I had only loaded `lti.jar` in Eclipse and I got an `UnsatisfiedLinkException` which means it expects me to do the loading of dll? – An SO User Mar 31 '13 at 03:04
  • Leave it as is within eclipse. You could make a script or use ant to package your app for distrubution in which you set the CLASSPATH. That mean the dir structure in eclipse and your dist will be different, but is that ok? – Jess Mar 31 '13 at 03:10
  • Now that I do not have any options, yes it is ok! – An SO User Mar 31 '13 at 03:12
0

You can right-click on the project, then click "properties" -> Java Build Path -> Add Jars

That should do the trick :)

Héctor van den Boorn
  • 1,218
  • 13
  • 32