score:1
each eclipse plugin has its own classpath. to use additional jars in the plugin you need to include them in the plugin.
add your jars to the plugin directory. usually they are put in a 'lib' directory.
open the plugin manifest.mf editor and on the 'runtime' tab in the 'classpath' section click the 'add...' button and add your jars to the class path.
on the 'build' tab of the editor make sure the 'lib' folder is include in the binary build section.
your manifest.mf should end up with a `bundle-classpath' entry that looks something like:
bundle-classpath: .,
lib/jogg-0.0.7.jar,
lib/jorbis-0.0.15.jar,
lib/vorbisspi1.0.2.jar
(here i have 3 jars in a lib folder).
the build.properties file should be something like:
bin.includes = meta-inf/,\
.,\
plugin.xml,\
lib/,\
lib/jogg-0.0.7.jar,\
lib/jorbis-0.0.15.jar,\
lib/vorbisspi1.0.2.jar
score:0
the best approach i've found is to create a lib
directory in your eclipse project (where your view is contained). place your .jar files in said lib directory.
then using the editor on the manifest.mf, you add the .jar files to the classpath. if you wish to export the packages, you then add to the exported packages as well.
depending upon what you are doing, you may wish/need to also update the build configuration.
if you examine the manifest.mf
file itself, you will then see an entry for bundle-classpath
. it will list your entries. here it has the standard "." for the project, a resources/
directory that we export, and a couple of .jar files.
bundle-classpath: .,
resources/,
lib/aopalliance-1.0.jar,
lib/apccore-client-2.11.8.jar,
lib/cglib-nodep-2.2.2.jar,
lib/ehcache-2.10.3.jar,
...
note that in our experience, it is also necessary to adjust the java build path from the properties of the project itself. a user commented that this step may not be necessary. we are on an older version of eclipse due to our product, so ymmv, if needed (usually compile failures are the indicator), you then need to add, via the properties context menu on the project, the .jar files to the "java build path" (you can do the same with a resources directory).
this will allow you to properly build using the .jar files.
score:0
for compile time we need to add it to the project runtime library.
for the run time you have to package the jar either in your ear/war file or load it to the application server as a app server libraries.
please let me know if you need further assistance on this.
Source: stackoverflow.com
Related Query
- Manipulate the java class path of an Eclipse plugin?
- m2e plugin - Eclipse - created Java class and package. Not recognized as part of the project
- class not found exception in eclipse even though the user library containg jar file is in java build path
- Eclipse "this compilation unit is not on the build path of a java project"
- UML Plugin for Eclipse - Class Diagrams & Java Code Generation - Indigo/Juno
- Unbound class path variable java android eclipse
- How do I set the Eclipse build path and class path from an Ant build file?
- How to set the class path in Eclipse and Android Studio
- In the activator class of an Eclipse plugin how can I find view instances?
- Eclipse plugin : Get the enclosing class and member name
- Eclipse Plugin for creating large java class diagrams from existing code
- Shortcut key to switch between XML layout and the java class in eclipse (android )
- Setting the JRE of java eclipse project in plugin programmatically
- Java 11 and E(fx)clipse JavaFX plugin on Eclipse 4.9: An error has occurred - see the log file
- How to get the current project path from eclipse using java
- How to add the android-async-http.JAR in Eclipse Java Build Path
- How to get the output classes path of the project in the eclipse plugin
- Eclipse and Apache Axis2 plugin Java Soap -- Class not found
- Debugging with Jetty Maven Plugin in Eclipse on multi module project: Compilation unit not on the build path
- How do I set the Java path in Eclipse so I can run it on an external drive?
- Eclipse - return excluded java file back to the build path
- Warning in jsp : The tag handler class for "s:form" (org.apache.struts2.views.jsp.ui.FormTag) was not found on the Java Build Path
- Class defined in another plugin cannot be found by the main plugin - Eclipse Product
- import error while adding TextEditor to eclipse plugin - Cannot find the class file for org.eclipse.jface.text.revisions.RevisionInformation
- Contributing a template to Eclipse via a Plugin to the Java Editor, but should vary based on the context
- how to run eclipse by using a specified java path directory in eclipse not by the default Java path
- Run a Java class on Eclipse automatically without pressing the "run" button
- Eclipse how to see the Java file instead of class file
- How to find the class that throws an exception in Java using Eclipse
- Can an Ant build script to reference the Eclipse plugin folder without full path details?
More Query from same tag
- I can not see with db Questoid SQLite Browser
- Configure Eclipse formatter to add newline in front of h:panelGroup
- Why did pressing dot after an object in Eclipse stop showing list of methods popup?
- ADT Eclipse SDK troubles - No DDMS found
- Eclipse and derby
- Eclipse count lines of code
- JSF-pages are not affected by Eclipse's refactoring function
- Simple RSS Feed Can't Open Website
- Problem with installing an application on android
- Issue with Proguard
- Download link is not working in phonegap
- Android emulator not starting on Ubuntu 10.10
- Logcat show invisible messages in Eclipse Mars
- How to switch bewteen panels in WindowBuilder (Java)
- Android app name not changed in status bar when launching in eclipse
- Eclipse Ant Builder problem
- Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M3:test (default-test) on project. while 'Run as Maven test'
- Git setting eclipse project files as read-only
- agent library failed to init: instrument
- Eclipse Bar Above Code
- Eclipse heap walk
- Is eclipse AutoCompleteField only suggesting entries starting with entered text?
- Blank Graphical Layout?
- Eclipse - build only java part and native part I will build with ndk-build tool
- ResourceException when creating IMarker on IFile (linked resource)
- Error in scala IDE
- Trying to develop mods for minecraft, but can't get the SetupdecompWorkspace.bat to work
- Searching the mpaa cast file for movies with an actor in them?
- Symbol 'cout' could not be resolved and #include expects "FILENAME" errors with simple math program in eclipse
- java.lang.NoClassDefFoundError: com/googlecode/objectify/ObjectifyService