It's all about the answers!

Ask a question

Add external jars into eclipse plugin project


vikrant kamble (132878) | asked Jun 23 '15, 5:59 a.m.
edited Jun 23 '15, 6:33 a.m. by Ralph Schoon (59.7k23643)
How to add external jars into eclipse plugin project in RTC?
(I know there is one option available create plugin from existing jar archives. and somewhere i read that adding external jars through build path doesn't work for plugin project in RTC )
I want to know a method other than this

Thank you

Accepted answer


permanent link
Ralph Schoon (59.7k23643) | answered Jun 23 '15, 6:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 Please see https://jazz.net/forum/questions/93445/server-side-extension-and-spring/93470
vikrant kamble selected this answer as the correct answer

Comments
Ralph Schoon commented Jun 23 '15, 6:55 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 You might have to export your library, if you put it into another plugin. See the plugin.xml tabs.


vikrant kamble commented Jun 23 '15, 6:56 a.m.

I did it following way

  1. Use Import>File System to import the jar files into your plugin project, say in the /lib directory.
  2. Use "Add..." to add the jars to the classpath section of the plugin.xml>Runtime tab.
  3. Use "New..." to add "." library back (with no quotes, of course).
  4. make sure your binary build exports the new jar files on the plugin.xml>Build tab.
  5. save
  6. on the project, use context menu>PDE Tools>Update Classpath to correctly add the jars to the eclipse project classpath.

This worked for me first time and in the "lib" folder it created Three more folders which are "com", "META-INF", "sqlj" and one file name "T4XAIndbtPkg.SJPeofile().ser"

I dont know how these folders and files were created but it worked for me.

When I opened "com" folder I felt like one of my jar was extracted in that folder showing all the list of packages which were contained in the jar file.

But It is not working now. What may be reason?


vikrant kamble commented Jun 23 '15, 6:58 a.m.

I did it following way

  1. Use Import>File System to import the jar files into your plugin project, say in the /lib directory.
  2. Use "Add..." to add the jars to the classpath section of the plugin.xml>Runtime tab.
  3. Use "New..." to add "." library back (with no quotes, of course).
  4. make sure your binary build exports the new jar files on the plugin.xml>Build tab.
  5. save
  6. on the project, use context menu>PDE Tools>Update Classpath to correctly add the jars to the eclipse project classpath.

This worked for me first time and in the "lib" folder it created Three more folders which are "com", "META-INF", "sqlj" and one file name "T4XAIndbtPkg.SJPeofile().ser"

I dont know how these folders and files were created but it worked for me.

When I opened "com" folder I felt like one of my jar was extracted in that folder showing all the list of packages which were contained in the jar file.

But It is not working now. What may be reason


vikrant kamble commented Jun 23 '15, 7:11 a.m. | edited Jun 23 '15, 7:14 a.m.

Mistakenly it got posted twice. I did above procedure to add external jar into plugin project but it is not working now. Am i missing something or am i doing something wrong

Thank you


Ralph Schoon commented Jun 23 '15, 7:58 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I can't tell. When I did this way back, I got it working.

Your answer


Register or to post your answer.