Home » Eclipse Projects » Rich Client Platform (RCP) » Third party jars needing java.class.path in RCP application
| |
Re: Third party jars needing java.class.path in RCP application [message #453325 is a reply to message #453322] |
Wed, 26 July 2006 12:12 |
ChrisTina Lewin Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Hi Tom,
first option didn't work, it was ignored. It works with Java applications
I think. Eclipse applications work different I found.
Second option sounds good to me and I tried it, but it didn't work as well
although I'm not sure about the syntax. I checked "Eclipse runtime options"
manual page and the following entry seemed to be right:
"osgi.dev". It didn't work as well just giving the path in the form of
"c:\something\something_else". Maybe I have to state it in a different form,
but I'm at a loss.
But thanks anyway, Tom :-)
Christine
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:ea7c3v$3i1$1@utils.eclipse.org...
> Hi,
>
> First of all I'm not sure about that because I have never used it myself
> but:
>
> I think you have 2 options:
>
> 1. Execute your application using: app.exe -vmargs -Djava.class.path=.
> 2. Edit config.ini in your product.
>
> Tom
>
> ChrisTina Lewin schrieb:
>> I use a third party product in my RCP application. The third party
>> software
>> is in a separate plugin consisting of the necessary jars, my application
>> is
>> in a second plugin. I do not have ths source of the third party software
>> but
>> I know for sure that they do a System.getProperty("java.class.path") in
>> order
>> to access a configuration file. So far so good.
>> All is well when I run my application within Eclipse because in the "run
>> dialog"
>> I can set Bootstrap Entries to -Djava.class.path="<path>" and I can also
>> set
>> the PATH variable to native code libs in the "environment tab".
>>
>> My problem now starts when I export my project. Where can is set my java
>> classpath
>> and my PATH variable in an exported project? I tried osgi.dev entry in
>> config.ini,
>> it didn' work (maybe I got the syntay wrong).
>> Can anybody help me with this. There must be a way because I cannot
>> imagine
>> I am
>> the only person integrating "older" third party software requring java
>> classpath.
>> It works with Java Applications but I MUST work with Eclipse
>> applications.
>>
>> I'm grateful for any hint,
>>
>> Christine
>>
>>
|
|
|
Re: Third party jars needing java.class.path in RCP application [message #453329 is a reply to message #453319] |
Wed, 26 July 2006 14:18 |
Eclipse User |
|
|
|
Originally posted by: dittmar.steiner.web.de
ChrisTina Lewin schrieb:
> I use a third party product in my RCP application. The third party software
> is in a separate plugin consisting of the necessary jars, my application is
> in a second plugin. I do not have ths source of the third party software but
> I know for sure that they do a System.getProperty("java.class.path") in
> order
> to access a configuration file. So far so good.
> All is well when I run my application within Eclipse because in the "run
> dialog"
> I can set Bootstrap Entries to -Djava.class.path="<path>" and I can also set
> the PATH variable to native code libs in the "environment tab".
>
> My problem now starts when I export my project. Where can is set my java
> classpath
> and my PATH variable in an exported project? I tried osgi.dev entry in
> config.ini,
> it didn' work (maybe I got the syntay wrong).
> Can anybody help me with this. There must be a way because I cannot imagine
> I am
> the only person integrating "older" third party software requring java
> classpath.
> It works with Java Applications but I MUST work with Eclipse applications.
>
> I'm grateful for any hint,
>
> Christine
>
>
Hi Christina,
The thirdparty plugin's class loader cannot see/access classes of your application plugin by default. Despite your application
arguments or config.ini. So it doesn't matter what you put in your System.property.
Solutions:
a) Make you thirdparty plug depending on your plugin holding the configuration file
Not really elegant.
b) Put the configuration file into your third party plugin and add it's location into the plugin's class path.
i won't like it.
c) if possible inject your application's classLoader into the responsible third party class.
This works excellent for a XStream object for example.
Example:
The XStream objectis instantiated from MyPlugin.
Then the XStream object is given the MyPlugin's classLoader: Activalor.class.getClassLoader()
Now the XStream object can refer to classes within MyPlugin by given classes or classNames.
Does this meet your problem?
regards
Dittmar
--
Quidquid latine dictum sit, altum sonatur.
- Whatever is said in Latin sounds profound.
|
|
| |
Re: Third party jars needing java.class.path in RCP application [message #453339 is a reply to message #453338] |
Wed, 26 July 2006 19:47 |
Dennis Park Messages: 3 Registered: July 2009 |
Junior Member |
|
|
Oh yeah,
then reinsert the mf back into the plugin u extracted it from.
"Dennis Park" <denpark@cisco.com> wrote in message
news:ea8gqq$cc0$1@utils.eclipse.org...
> Open the third party plugin and pull out it's manifest.mf. This file
> needs to be modified, so as to expose each java package that you want
> other plugins to see. (There are other ways to accomplish this--look up
> buddies). In the mf file, you need to add:
>
> Export-Package: com.xxx.xxx.xxx1
>
> com.xxx.xx.xxx2
>
> com.xxx.xx.xxx3
>
> com.xxx.xx.xxx4
>
> .
>
> .
>
> .
>
> etc.
>
>
>
> This should be done for each pkg that needs to be exposed. If you open
> the mf in the eclipse mf editor, you can do this through a nice ui, by
> selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>
> Hope this helps.
>
>
>
> Dennis
>
>
>
>
>
> "ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in message
> news:ea76gu$v77$1@utils.eclipse.org...
>>I use a third party product in my RCP application. The third party
>>software
>> is in a separate plugin consisting of the necessary jars, my application
>> is
>> in a second plugin. I do not have ths source of the third party software
>> but
>> I know for sure that they do a System.getProperty("java.class.path") in
>> order
>> to access a configuration file. So far so good.
>> All is well when I run my application within Eclipse because in the "run
>> dialog"
>> I can set Bootstrap Entries to -Djava.class.path="<path>" and I can also
>> set
>> the PATH variable to native code libs in the "environment tab".
>>
>> My problem now starts when I export my project. Where can is set my java
>> classpath
>> and my PATH variable in an exported project? I tried osgi.dev entry in
>> config.ini,
>> it didn' work (maybe I got the syntay wrong).
>> Can anybody help me with this. There must be a way because I cannot
>> imagine I am
>> the only person integrating "older" third party software requring java
>> classpath.
>> It works with Java Applications but I MUST work with Eclipse
>> applications.
>>
>> I'm grateful for any hint,
>>
>> Christine
>>
>
>
|
|
|
Re: Third party jars needing java.class.path in RCP application [message #453352 is a reply to message #453339] |
Thu, 27 July 2006 08:31 |
ChrisTina Lewin Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Hi Dennis,
this I did, all packages of the third party software appear in the exported
list of the runtime
tab. I added the configuration file to the classpath list, so it IS in the
plugins classpath.
I have no problems running my project within eclipse because of my bootstrap
entries in the run
tab of eclipse. As soon as I export the project to create a product, I get
the problem of "file
not found" because my classpath entry is not there anymore.
The key problem is that the third party software make a call to
System.getProperties("java.class.pass")
and expects the path to the darned config file which unfortunately it
doesn't get.
So your suggested entries didn't work, unfortunately :-(
But thanks anyway,
Christine
"Dennis Park" <denpark@cisco.com> wrote in message
news:ea8gtb$dck$1@utils.eclipse.org...
> Oh yeah,
> then reinsert the mf back into the plugin u extracted it from.
>
>
> "Dennis Park" <denpark@cisco.com> wrote in message
> news:ea8gqq$cc0$1@utils.eclipse.org...
>> Open the third party plugin and pull out it's manifest.mf. This file
>> needs to be modified, so as to expose each java package that you want
>> other plugins to see. (There are other ways to accomplish this--look up
>> buddies). In the mf file, you need to add:
>>
>> Export-Package: com.xxx.xxx.xxx1
>>
>> com.xxx.xx.xxx2
>>
>> com.xxx.xx.xxx3
>>
>> com.xxx.xx.xxx4
>>
>> .
>>
>> .
>>
>> .
>>
>> etc.
>>
>>
>>
>> This should be done for each pkg that needs to be exposed. If you open
>> the mf in the eclipse mf editor, you can do this through a nice ui, by
>> selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>>
>> Hope this helps.
>>
>>
>>
>> Dennis
>>
>>
>>
>>
>>
>> "ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in message
>> news:ea76gu$v77$1@utils.eclipse.org...
>>>I use a third party product in my RCP application. The third party
>>>software
>>> is in a separate plugin consisting of the necessary jars, my application
>>> is
>>> in a second plugin. I do not have ths source of the third party software
>>> but
>>> I know for sure that they do a System.getProperty("java.class.path") in
>>> order
>>> to access a configuration file. So far so good.
>>> All is well when I run my application within Eclipse because in the "run
>>> dialog"
>>> I can set Bootstrap Entries to -Djava.class.path="<path>" and I can also
>>> set
>>> the PATH variable to native code libs in the "environment tab".
>>>
>>> My problem now starts when I export my project. Where can is set my
>>> java classpath
>>> and my PATH variable in an exported project? I tried osgi.dev entry in
>>> config.ini,
>>> it didn' work (maybe I got the syntay wrong).
>>> Can anybody help me with this. There must be a way because I cannot
>>> imagine I am
>>> the only person integrating "older" third party software requring java
>>> classpath.
>>> It works with Java Applications but I MUST work with Eclipse
>>> applications.
>>>
>>> I'm grateful for any hint,
>>>
>>> Christine
>>>
>>
>>
>
>
|
|
| |
Re: Third party jars needing java.class.path in RCP application [message #453369 is a reply to message #453352] |
Thu, 27 July 2006 18:21 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Is the model only reading the value and constructs the Path afterwards
to fully qualify the file? It that's the case have you tried setting the
value at startup with something like this:
System.setProperty("java.class.path",
System.getProperty("java.class.path")+";"+"C:/myPath");
Tom
ChrisTina Lewin wrote:
> Hi Dennis,
>
> this I did, all packages of the third party software appear in the exported
> list of the runtime
> tab. I added the configuration file to the classpath list, so it IS in the
> plugins classpath.
> I have no problems running my project within eclipse because of my bootstrap
> entries in the run
> tab of eclipse. As soon as I export the project to create a product, I get
> the problem of "file
> not found" because my classpath entry is not there anymore.
> The key problem is that the third party software make a call to
> System.getProperties("java.class.pass")
> and expects the path to the darned config file which unfortunately it
> doesn't get.
> So your suggested entries didn't work, unfortunately :-(
>
> But thanks anyway,
> Christine
>
>
> "Dennis Park" <denpark@cisco.com> wrote in message
> news:ea8gtb$dck$1@utils.eclipse.org...
>
>>Oh yeah,
>>then reinsert the mf back into the plugin u extracted it from.
>>
>>
>>"Dennis Park" <denpark@cisco.com> wrote in message
>>news:ea8gqq$cc0$1@utils.eclipse.org...
>>
>>>Open the third party plugin and pull out it's manifest.mf. This file
>>>needs to be modified, so as to expose each java package that you want
>>>other plugins to see. (There are other ways to accomplish this--look up
>>>buddies). In the mf file, you need to add:
>>>
>>>Export-Package: com.xxx.xxx.xxx1
>>>
>>>com.xxx.xx.xxx2
>>>
>>>com.xxx.xx.xxx3
>>>
>>>com.xxx.xx.xxx4
>>>
>>>.
>>>
>>>.
>>>
>>>.
>>>
>>>etc.
>>>
>>>
>>>
>>>This should be done for each pkg that needs to be exposed. If you open
>>>the mf in the eclipse mf editor, you can do this through a nice ui, by
>>>selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>>>
>>>Hope this helps.
>>>
>>>
>>>
>>>Dennis
>>>
>>>
>>>
>>>
>>>
>>>"ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in message
>>>news:ea76gu$v77$1@utils.eclipse.org...
>>>
>>>>I use a third party product in my RCP application. The third party
>>>>software
>>>>is in a separate plugin consisting of the necessary jars, my application
>>>>is
>>>>in a second plugin. I do not have ths source of the third party software
>>>>but
>>>>I know for sure that they do a System.getProperty("java.class.path") in
>>>>order
>>>>to access a configuration file. So far so good.
>>>>All is well when I run my application within Eclipse because in the "run
>>>>dialog"
>>>>I can set Bootstrap Entries to -Djava.class.path="<path>" and I can also
>>>>set
>>>>the PATH variable to native code libs in the "environment tab".
>>>>
>>>>My problem now starts when I export my project. Where can is set my
>>>>java classpath
>>>>and my PATH variable in an exported project? I tried osgi.dev entry in
>>>>config.ini,
>>>>it didn' work (maybe I got the syntay wrong).
>>>>Can anybody help me with this. There must be a way because I cannot
>>>>imagine I am
>>>>the only person integrating "older" third party software requring java
>>>>classpath.
>>>>It works with Java Applications but I MUST work with Eclipse
>>>>applications.
>>>>
>>>>I'm grateful for any hint,
>>>>
>>>>Christine
>>>>
>>>
>>>
>>
>
>
|
|
|
Re: Third party jars needing java.class.path in RCP application [message #453370 is a reply to message #453369] |
Thu, 27 July 2006 18:24 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
Sorry its late in the evening after a hard working day. Now in readable
English ;-)
Is the lib you are using reading the value and afterwards constructs a
fully qualified path from it then you can try setting the
java.class.path like this:
System.setProperty("java.class.path",System.getProperty("java.class.path ")+";"+"C:/myPath");
This will not have any effect for classloaders.
Tom
Tom Schindl wrote:
> Is the model only reading the value and constructs the Path afterwards
> to fully qualify the file? It that's the case have you tried setting the
> value at startup with something like this:
>
> System.setProperty("java.class.path",
> System.getProperty("java.class.path")+";"+"C:/myPath");
>
> Tom
>
> ChrisTina Lewin wrote:
>
>>Hi Dennis,
>>
>>this I did, all packages of the third party software appear in the exported
>>list of the runtime
>>tab. I added the configuration file to the classpath list, so it IS in the
>>plugins classpath.
>>I have no problems running my project within eclipse because of my bootstrap
>>entries in the run
>>tab of eclipse. As soon as I export the project to create a product, I get
>>the problem of "file
>>not found" because my classpath entry is not there anymore.
>>The key problem is that the third party software make a call to
>>System.getProperties("java.class.pass")
>>and expects the path to the darned config file which unfortunately it
>>doesn't get.
>>So your suggested entries didn't work, unfortunately :-(
>>
>>But thanks anyway,
>>Christine
>>
>>
>>"Dennis Park" <denpark@cisco.com> wrote in message
>>news:ea8gtb$dck$1@utils.eclipse.org...
>>
>>
>>>Oh yeah,
>>>then reinsert the mf back into the plugin u extracted it from.
>>>
>>>
>>>"Dennis Park" <denpark@cisco.com> wrote in message
>>>news:ea8gqq$cc0$1@utils.eclipse.org...
>>>
>>>
>>>>Open the third party plugin and pull out it's manifest.mf. This file
>>>>needs to be modified, so as to expose each java package that you want
>>>>other plugins to see. (There are other ways to accomplish this--look up
>>>>buddies). In the mf file, you need to add:
>>>>
>>>>Export-Package: com.xxx.xxx.xxx1
>>>>
>>>>com.xxx.xx.xxx2
>>>>
>>>>com.xxx.xx.xxx3
>>>>
>>>>com.xxx.xx.xxx4
>>>>
>>>>.
>>>>
>>>>.
>>>>
>>>>.
>>>>
>>>>etc.
>>>>
>>>>
>>>>
>>>>This should be done for each pkg that needs to be exposed. If you open
>>>>the mf in the eclipse mf editor, you can do this through a nice ui, by
>>>>selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>>>>
>>>>Hope this helps.
>>>>
>>>>
>>>>
>>>>Dennis
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>"ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in message
>>>>news:ea76gu$v77$1@utils.eclipse.org...
>>>>
>>>>
>>>>>I use a third party product in my RCP application. The third party
>>>>>software
>>>>>is in a separate plugin consisting of the necessary jars, my application
>>>>>is
>>>>>in a second plugin. I do not have ths source of the third party software
>>>>>but
>>>>>I know for sure that they do a System.getProperty("java.class.path") in
>>>>>order
>>>>>to access a configuration file. So far so good.
>>>>>All is well when I run my application within Eclipse because in the "run
>>>>>dialog"
>>>>>I can set Bootstrap Entries to -Djava.class.path="<path>" and I can also
>>>>>set
>>>>>the PATH variable to native code libs in the "environment tab".
>>>>>
>>>>>My problem now starts when I export my project. Where can is set my
>>>>>java classpath
>>>>>and my PATH variable in an exported project? I tried osgi.dev entry in
>>>>>config.ini,
>>>>>it didn' work (maybe I got the syntay wrong).
>>>>>Can anybody help me with this. There must be a way because I cannot
>>>>>imagine I am
>>>>>the only person integrating "older" third party software requring java
>>>>>classpath.
>>>>>It works with Java Applications but I MUST work with Eclipse
>>>>>applications.
>>>>>
>>>>>I'm grateful for any hint,
>>>>>
>>>>>Christine
>>>>>
>>>>
>>>>
>>
|
|
|
Re: Third party jars needing java.class.path in RCP application [message #453380 is a reply to message #453370] |
Thu, 27 July 2006 19:40 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
I experimented a little bit and think the problem is that when you are
launching the application using eclipse.exe after exporting the
application starts with java -jar this way only the startup.jar is in
the class-path whereas when you run your application from within eclipse
it is started not like this but similar to the lines below.
But the starter is in fact a fairly dumb thing you could emulate your
own by calling:
> java -classpath startup.jar;C:/bla;My.jar org.eclipse.core.launcher.Main -os win32 -ws win32 -arch x86 -launcher eclipse -name Eclipse -showsplash 600 -exitdata 9000c -vm java -vmargs -jar startup.jar
Please note my own changes to the class-path: C:/bla;My.jar.
I'm not sure what the values for -os and -ws are (because I ran it on
linux) but the minum line looks like this:
> java -classpath startup.jar;C:/bla;My.jar org.eclipse.core.launcher.Main -launcher eclipse -name Eclipse -showsplash 600
Tom
Tom Schindl wrote:
> Sorry its late in the evening after a hard working day. Now in readable
> English ;-)
>
> Is the lib you are using reading the value and afterwards constructs a
> fully qualified path from it then you can try setting the
> java.class.path like this:
>
> System.setProperty("java.class.path",System.getProperty("java.class.path ")+";"+"C:/myPath");
>
> This will not have any effect for classloaders.
>
> Tom
>
> Tom Schindl wrote:
>
>>Is the model only reading the value and constructs the Path afterwards
>>to fully qualify the file? It that's the case have you tried setting the
>>value at startup with something like this:
>>
>>System.setProperty("java.class.path",
>>System.getProperty("java.class.path")+";"+"C:/myPath");
>>
>>Tom
>>
>>ChrisTina Lewin wrote:
>>
>>
>>>Hi Dennis,
>>>
>>>this I did, all packages of the third party software appear in the exported
>>>list of the runtime
>>>tab. I added the configuration file to the classpath list, so it IS in the
>>>plugins classpath.
>>>I have no problems running my project within eclipse because of my bootstrap
>>>entries in the run
>>>tab of eclipse. As soon as I export the project to create a product, I get
>>>the problem of "file
>>>not found" because my classpath entry is not there anymore.
>>>The key problem is that the third party software make a call to
>>>System.getProperties("java.class.pass")
>>>and expects the path to the darned config file which unfortunately it
>>>doesn't get.
>>>So your suggested entries didn't work, unfortunately :-(
>>>
>>>But thanks anyway,
>>>Christine
>>>
>>>
>>>"Dennis Park" <denpark@cisco.com> wrote in message
>>>news:ea8gtb$dck$1@utils.eclipse.org...
>>>
>>>
>>>
>>>>Oh yeah,
>>>>then reinsert the mf back into the plugin u extracted it from.
>>>>
>>>>
>>>>"Dennis Park" <denpark@cisco.com> wrote in message
>>>>news:ea8gqq$cc0$1@utils.eclipse.org...
>>>>
>>>>
>>>>
>>>>>Open the third party plugin and pull out it's manifest.mf. This file
>>>>>needs to be modified, so as to expose each java package that you want
>>>>>other plugins to see. (There are other ways to accomplish this--look up
>>>>>buddies). In the mf file, you need to add:
>>>>>
>>>>>Export-Package: com.xxx.xxx.xxx1
>>>>>
>>>>>com.xxx.xx.xxx2
>>>>>
>>>>>com.xxx.xx.xxx3
>>>>>
>>>>>com.xxx.xx.xxx4
>>>>>
>>>>>.
>>>>>
>>>>>.
>>>>>
>>>>>.
>>>>>
>>>>>etc.
>>>>>
>>>>>
>>>>>
>>>>>This should be done for each pkg that needs to be exposed. If you open
>>>>>the mf in the eclipse mf editor, you can do this through a nice ui, by
>>>>>selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>>>>>
>>>>>Hope this helps.
>>>>>
>>>>>
>>>>>
>>>>>Dennis
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>"ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in message
>>>>>news:ea76gu$v77$1@utils.eclipse.org...
>>>>>
>>>>>
>>>>>
>>>>>>I use a third party product in my RCP application. The third party
>>>>>>software
>>>>>>is in a separate plugin consisting of the necessary jars, my application
>>>>>>is
>>>>>>in a second plugin. I do not have ths source of the third party software
>>>>>>but
>>>>>>I know for sure that they do a System.getProperty("java.class.path") in
>>>>>>order
>>>>>>to access a configuration file. So far so good.
>>>>>>All is well when I run my application within Eclipse because in the "run
>>>>>>dialog"
>>>>>>I can set Bootstrap Entries to -Djava.class.path="<path>" and I can also
>>>>>>set
>>>>>>the PATH variable to native code libs in the "environment tab".
>>>>>>
>>>>>>My problem now starts when I export my project. Where can is set my
>>>>>>java classpath
>>>>>>and my PATH variable in an exported project? I tried osgi.dev entry in
>>>>>>config.ini,
>>>>>>it didn' work (maybe I got the syntay wrong).
>>>>>>Can anybody help me with this. There must be a way because I cannot
>>>>>>imagine I am
>>>>>>the only person integrating "older" third party software requring java
>>>>>>classpath.
>>>>>>It works with Java Applications but I MUST work with Eclipse
>>>>>>applications.
>>>>>>
>>>>>>I'm grateful for any hint,
>>>>>>
>>>>>>Christine
>>>>>>
>>>>>
>>>>>
|
|
|
Re: Third party jars needing java.class.path in RCP application [message #453383 is a reply to message #453380] |
Thu, 27 July 2006 23:19 |
J. Michael Dean, M.D. Messages: 218 Registered: July 2009 |
Senior Member |
|
|
I am hesitant to weigh in on this discussion because not certain of the
issue, but have you wrapped the third party library in a separate plugin,
and included within that plugin the configuration file that is expected?
Each plugin has its own classpath, etc.
The other potential issue is whether this third party plugin needs any
knowledge of YOUR classes, etc. There is a very nice mechanism called the
Buddy Loader that can fix this. If a plugin like Hibernate, for example,
does not know about other code it needs to work with, it can register as a
buddy listener, and your own code can open itself up to that plugin. This
involves editing the manifest.mf file and is well described in the Eclipse
documentation.
If your third party library is wrapped in a plugin, contains the config
file, and you edit the manifest.mf for the plugin as well as your own
plugin, this might solve your problem. No guarantees since most problems
that I solve seem to be by luck and brute persistence.
- Mike
On 7/27/06 1:40 PM, in article eab4rf$g98$1@utils.eclipse.org, "Tom Schindl"
<tom.schindl@bestsolution.at> wrote:
> I experimented a little bit and think the problem is that when you are
> launching the application using eclipse.exe after exporting the
> application starts with java -jar this way only the startup.jar is in
> the class-path whereas when you run your application from within eclipse
> it is started not like this but similar to the lines below.
>
> But the starter is in fact a fairly dumb thing you could emulate your
> own by calling:
>
>> java -classpath startup.jar;C:/bla;My.jar org.eclipse.core.launcher.Main -os
>> win32 -ws win32 -arch x86 -launcher eclipse -name Eclipse -showsplash 600
>> -exitdata 9000c -vm java -vmargs -jar startup.jar
>
> Please note my own changes to the class-path: C:/bla;My.jar.
>
> I'm not sure what the values for -os and -ws are (because I ran it on
> linux) but the minum line looks like this:
>
>> java -classpath startup.jar;C:/bla;My.jar org.eclipse.core.launcher.Main
>> -launcher eclipse -name Eclipse -showsplash 600
>
> Tom
>
> Tom Schindl wrote:
>> Sorry its late in the evening after a hard working day. Now in readable
>> English ;-)
>>
>> Is the lib you are using reading the value and afterwards constructs a
>> fully qualified path from it then you can try setting the
>> java.class.path like this:
>>
>> System.setProperty("java.class.path",System.getProperty("java.class.path ")+";
>> "+"C:/myPath");
>>
>> This will not have any effect for classloaders.
>>
>> Tom
>>
>> Tom Schindl wrote:
>>
>>> Is the model only reading the value and constructs the Path afterwards
>>> to fully qualify the file? It that's the case have you tried setting the
>>> value at startup with something like this:
>>>
>>> System.setProperty("java.class.path",
>>> System.getProperty("java.class.path")+";"+"C:/myPath");
>>>
>>> Tom
>>>
>>> ChrisTina Lewin wrote:
>>>
>>>
>>>> Hi Dennis,
>>>>
>>>> this I did, all packages of the third party software appear in the exported
>>>> list of the runtime
>>>> tab. I added the configuration file to the classpath list, so it IS in the
>>>> plugins classpath.
>>>> I have no problems running my project within eclipse because of my
>>>> bootstrap
>>>> entries in the run
>>>> tab of eclipse. As soon as I export the project to create a product, I get
>>>> the problem of "file
>>>> not found" because my classpath entry is not there anymore.
>>>> The key problem is that the third party software make a call to
>>>> System.getProperties("java.class.pass")
>>>> and expects the path to the darned config file which unfortunately it
>>>> doesn't get.
>>>> So your suggested entries didn't work, unfortunately :-(
>>>>
>>>> But thanks anyway,
>>>> Christine
>>>>
>>>>
>>>> "Dennis Park" <denpark@cisco.com> wrote in message
>>>> news:ea8gtb$dck$1@utils.eclipse.org...
>>>>
>>>>
>>>>
>>>>> Oh yeah,
>>>>> then reinsert the mf back into the plugin u extracted it from.
>>>>>
>>>>>
>>>>> "Dennis Park" <denpark@cisco.com> wrote in message
>>>>> news:ea8gqq$cc0$1@utils.eclipse.org...
>>>>>
>>>>>
>>>>>
>>>>>> Open the third party plugin and pull out it's manifest.mf. This file
>>>>>> needs to be modified, so as to expose each java package that you want
>>>>>> other plugins to see. (There are other ways to accomplish this--look up
>>>>>> buddies). In the mf file, you need to add:
>>>>>>
>>>>>> Export-Package: com.xxx.xxx.xxx1
>>>>>>
>>>>>> com.xxx.xx.xxx2
>>>>>>
>>>>>> com.xxx.xx.xxx3
>>>>>>
>>>>>> com.xxx.xx.xxx4
>>>>>>
>>>>>> .
>>>>>>
>>>>>> .
>>>>>>
>>>>>> .
>>>>>>
>>>>>> etc.
>>>>>>
>>>>>>
>>>>>>
>>>>>> This should be done for each pkg that needs to be exposed. If you open
>>>>>> the mf in the eclipse mf editor, you can do this through a nice ui, by
>>>>>> selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>>>>>>
>>>>>> Hope this helps.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Dennis
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> "ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in message
>>>>>> news:ea76gu$v77$1@utils.eclipse.org...
>>>>>>
>>>>>>
>>>>>>
>>>>>>> I use a third party product in my RCP application. The third party
>>>>>>> software
>>>>>>> is in a separate plugin consisting of the necessary jars, my application
>>>>>>> is
>>>>>>> in a second plugin. I do not have ths source of the third party software
>>>>>>> but
>>>>>>> I know for sure that they do a System.getProperty("java.class.path") in
>>>>>>> order
>>>>>>> to access a configuration file. So far so good.
>>>>>>> All is well when I run my application within Eclipse because in the "run
>>>>>>> dialog"
>>>>>>> I can set Bootstrap Entries to -Djava.class.path="<path>" and I can also
>>>>>>> set
>>>>>>> the PATH variable to native code libs in the "environment tab".
>>>>>>>
>>>>>>> My problem now starts when I export my project. Where can is set my
>>>>>>> java classpath
>>>>>>> and my PATH variable in an exported project? I tried osgi.dev entry in
>>>>>>> config.ini,
>>>>>>> it didn' work (maybe I got the syntay wrong).
>>>>>>> Can anybody help me with this. There must be a way because I cannot
>>>>>>> imagine I am
>>>>>>> the only person integrating "older" third party software requring java
>>>>>>> classpath.
>>>>>>> It works with Java Applications but I MUST work with Eclipse
>>>>>>> applications.
>>>>>>>
>>>>>>> I'm grateful for any hint,
>>>>>>>
>>>>>>> Christine
>>>>>>>
>>>>>>
>>>>>>
>
|
|
|
Re: Third party jars needing java.class.path in RCP application [message #453393 is a reply to message #453383] |
Fri, 28 July 2006 07:51 |
ChrisTina Lewin Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Hi Mike,
my third pary package is wrapped in a separate plugin, the configuration
file is included. The third pary software doesn't need any classes of my
application, the applications instantiates classes of the third party
package only.
I did try your third suggestion (I tried so much already), edited the
manifest etc., but it didn't work.
You are right, I also happen so solve these problems by sheer luck
and persistence.
Thanks for joining and offering your suggestions,
Christine
"J Michael Dean" <mdean77@comcast.net> wrote in message
news:C0EEA636.157AD%mdean77@comcast.net...
>I am hesitant to weigh in on this discussion because not certain of the
> issue, but have you wrapped the third party library in a separate plugin,
> and included within that plugin the configuration file that is expected?
> Each plugin has its own classpath, etc.
>
> The other potential issue is whether this third party plugin needs any
> knowledge of YOUR classes, etc. There is a very nice mechanism called the
> Buddy Loader that can fix this. If a plugin like Hibernate, for example,
> does not know about other code it needs to work with, it can register as a
> buddy listener, and your own code can open itself up to that plugin. This
> involves editing the manifest.mf file and is well described in the Eclipse
> documentation.
>
> If your third party library is wrapped in a plugin, contains the config
> file, and you edit the manifest.mf for the plugin as well as your own
> plugin, this might solve your problem. No guarantees since most problems
> that I solve seem to be by luck and brute persistence.
>
> - Mike
>
>
> On 7/27/06 1:40 PM, in article eab4rf$g98$1@utils.eclipse.org, "Tom
> Schindl"
> <tom.schindl@bestsolution.at> wrote:
>
>> I experimented a little bit and think the problem is that when you are
>> launching the application using eclipse.exe after exporting the
>> application starts with java -jar this way only the startup.jar is in
>> the class-path whereas when you run your application from within eclipse
>> it is started not like this but similar to the lines below.
>>
>> But the starter is in fact a fairly dumb thing you could emulate your
>> own by calling:
>>
>>> java -classpath startup.jar;C:/bla;My.jar
>>> org.eclipse.core.launcher.Main -os
>>> win32 -ws win32 -arch x86 -launcher eclipse -name Eclipse -showsplash
>>> 600
>>> -exitdata 9000c -vm java -vmargs -jar startup.jar
>>
>> Please note my own changes to the class-path: C:/bla;My.jar.
>>
>> I'm not sure what the values for -os and -ws are (because I ran it on
>> linux) but the minum line looks like this:
>>
>>> java -classpath startup.jar;C:/bla;My.jar org.eclipse.core.launcher.Main
>>> -launcher eclipse -name Eclipse -showsplash 600
>>
>> Tom
>>
>> Tom Schindl wrote:
>>> Sorry its late in the evening after a hard working day. Now in readable
>>> English ;-)
>>>
>>> Is the lib you are using reading the value and afterwards constructs a
>>> fully qualified path from it then you can try setting the
>>> java.class.path like this:
>>>
>>> System.setProperty("java.class.path",System.getProperty("java.class.path ")+";
>>> "+"C:/myPath");
>>>
>>> This will not have any effect for classloaders.
>>>
>>> Tom
>>>
>>> Tom Schindl wrote:
>>>
>>>> Is the model only reading the value and constructs the Path afterwards
>>>> to fully qualify the file? It that's the case have you tried setting
>>>> the
>>>> value at startup with something like this:
>>>>
>>>> System.setProperty("java.class.path",
>>>> System.getProperty("java.class.path")+";"+"C:/myPath");
>>>>
>>>> Tom
>>>>
>>>> ChrisTina Lewin wrote:
>>>>
>>>>
>>>>> Hi Dennis,
>>>>>
>>>>> this I did, all packages of the third party software appear in the
>>>>> exported
>>>>> list of the runtime
>>>>> tab. I added the configuration file to the classpath list, so it IS in
>>>>> the
>>>>> plugins classpath.
>>>>> I have no problems running my project within eclipse because of my
>>>>> bootstrap
>>>>> entries in the run
>>>>> tab of eclipse. As soon as I export the project to create a product, I
>>>>> get
>>>>> the problem of "file
>>>>> not found" because my classpath entry is not there anymore.
>>>>> The key problem is that the third party software make a call to
>>>>> System.getProperties("java.class.pass")
>>>>> and expects the path to the darned config file which unfortunately it
>>>>> doesn't get.
>>>>> So your suggested entries didn't work, unfortunately :-(
>>>>>
>>>>> But thanks anyway,
>>>>> Christine
>>>>>
>>>>>
>>>>> "Dennis Park" <denpark@cisco.com> wrote in message
>>>>> news:ea8gtb$dck$1@utils.eclipse.org...
>>>>>
>>>>>
>>>>>
>>>>>> Oh yeah,
>>>>>> then reinsert the mf back into the plugin u extracted it from.
>>>>>>
>>>>>>
>>>>>> "Dennis Park" <denpark@cisco.com> wrote in message
>>>>>> news:ea8gqq$cc0$1@utils.eclipse.org...
>>>>>>
>>>>>>
>>>>>>
>>>>>>> Open the third party plugin and pull out it's manifest.mf. This
>>>>>>> file
>>>>>>> needs to be modified, so as to expose each java package that you
>>>>>>> want
>>>>>>> other plugins to see. (There are other ways to accomplish
>>>>>>> this--look up
>>>>>>> buddies). In the mf file, you need to add:
>>>>>>>
>>>>>>> Export-Package: com.xxx.xxx.xxx1
>>>>>>>
>>>>>>> com.xxx.xx.xxx2
>>>>>>>
>>>>>>> com.xxx.xx.xxx3
>>>>>>>
>>>>>>> com.xxx.xx.xxx4
>>>>>>>
>>>>>>> .
>>>>>>>
>>>>>>> .
>>>>>>>
>>>>>>> .
>>>>>>>
>>>>>>> etc.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> This should be done for each pkg that needs to be exposed. If you
>>>>>>> open
>>>>>>> the mf in the eclipse mf editor, you can do this through a nice ui,
>>>>>>> by
>>>>>>> selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>>>>>>>
>>>>>>> Hope this helps.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Dennis
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> "ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in
>>>>>>> message
>>>>>>> news:ea76gu$v77$1@utils.eclipse.org...
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> I use a third party product in my RCP application. The third party
>>>>>>>> software
>>>>>>>> is in a separate plugin consisting of the necessary jars, my
>>>>>>>> application
>>>>>>>> is
>>>>>>>> in a second plugin. I do not have ths source of the third party
>>>>>>>> software
>>>>>>>> but
>>>>>>>> I know for sure that they do a
>>>>>>>> System.getProperty("java.class.path") in
>>>>>>>> order
>>>>>>>> to access a configuration file. So far so good.
>>>>>>>> All is well when I run my application within Eclipse because in the
>>>>>>>> "run
>>>>>>>> dialog"
>>>>>>>> I can set Bootstrap Entries to -Djava.class.path="<path>" and I can
>>>>>>>> also
>>>>>>>> set
>>>>>>>> the PATH variable to native code libs in the "environment tab".
>>>>>>>>
>>>>>>>> My problem now starts when I export my project. Where can is set my
>>>>>>>> java classpath
>>>>>>>> and my PATH variable in an exported project? I tried osgi.dev entry
>>>>>>>> in
>>>>>>>> config.ini,
>>>>>>>> it didn' work (maybe I got the syntay wrong).
>>>>>>>> Can anybody help me with this. There must be a way because I cannot
>>>>>>>> imagine I am
>>>>>>>> the only person integrating "older" third party software requring
>>>>>>>> java
>>>>>>>> classpath.
>>>>>>>> It works with Java Applications but I MUST work with Eclipse
>>>>>>>> applications.
>>>>>>>>
>>>>>>>> I'm grateful for any hint,
>>>>>>>>
>>>>>>>> Christine
>>>>>>>>
>>>>>>>
>>>>>>>
>>
>
|
|
|
Re: Third party jars needing java.class.path in RCP application [message #453394 is a reply to message #453380] |
Fri, 28 July 2006 07:55 |
ChrisTina Lewin Messages: 10 Registered: July 2009 |
Junior Member |
|
|
I'm also experimenting with commandline options atm. I also found that
command line options
can also be put in eclipse.ini or config.ini. So far no luck yet, but I
haven't tried all yet.
I'll let you ppl know whether and how it might work.
cheers,
Christine
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:eab4rf$g98$1@utils.eclipse.org...
>I experimented a little bit and think the problem is that when you are
> launching the application using eclipse.exe after exporting the
> application starts with java -jar this way only the startup.jar is in
> the class-path whereas when you run your application from within eclipse
> it is started not like this but similar to the lines below.
>
> But the starter is in fact a fairly dumb thing you could emulate your
> own by calling:
>
>> java -classpath startup.jar;C:/bla;My.jar
>> org.eclipse.core.launcher.Main -os win32 -ws win32 -arch x86 -launcher
>> eclipse -name Eclipse -showsplash 600 -exitdata 9000c -vm
>> java -vmargs -jar startup.jar
>
> Please note my own changes to the class-path: C:/bla;My.jar.
>
> I'm not sure what the values for -os and -ws are (because I ran it on
> linux) but the minum line looks like this:
>
>> java -classpath startup.jar;C:/bla;My.jar
>> org.eclipse.core.launcher.Main -launcher eclipse -name
>> Eclipse -showsplash 600
>
> Tom
>
> Tom Schindl wrote:
>> Sorry its late in the evening after a hard working day. Now in readable
>> English ;-)
>>
>> Is the lib you are using reading the value and afterwards constructs a
>> fully qualified path from it then you can try setting the
>> java.class.path like this:
>>
>> System.setProperty("java.class.path",System.getProperty("java.class.path ")+";"+"C:/myPath");
>>
>> This will not have any effect for classloaders.
>>
>> Tom
>>
>> Tom Schindl wrote:
>>
>>>Is the model only reading the value and constructs the Path afterwards
>>>to fully qualify the file? It that's the case have you tried setting the
>>>value at startup with something like this:
>>>
>>>System.setProperty("java.class.path",
>>>System.getProperty("java.class.path")+";"+"C:/myPath ");
>>>
>>>Tom
>>>
>>>ChrisTina Lewin wrote:
>>>
>>>
>>>>Hi Dennis,
>>>>
>>>>this I did, all packages of the third party software appear in the
>>>>exported
>>>>list of the runtime
>>>>tab. I added the configuration file to the classpath list, so it IS in
>>>>the
>>>>plugins classpath.
>>>>I have no problems running my project within eclipse because of my
>>>>bootstrap
>>>>entries in the run
>>>>tab of eclipse. As soon as I export the project to create a product, I
>>>>get
>>>>the problem of "file
>>>>not found" because my classpath entry is not there anymore.
>>>>The key problem is that the third party software make a call to
>>>>System.getProperties("java.class.pass")
>>>>and expects the path to the darned config file which unfortunately it
>>>>doesn't get.
>>>>So your suggested entries didn't work, unfortunately :-(
>>>>
>>>>But thanks anyway,
>>>>Christine
>>>>
>>>>
>>>>"Dennis Park" <denpark@cisco.com> wrote in message
>>>>news:ea8gtb$dck$1@utils.eclipse.org...
>>>>
>>>>
>>>>
>>>>>Oh yeah,
>>>>>then reinsert the mf back into the plugin u extracted it from.
>>>>>
>>>>>
>>>>>"Dennis Park" <denpark@cisco.com> wrote in message
>>>>>news:ea8gqq$cc0$1@utils.eclipse.org...
>>>>>
>>>>>
>>>>>
>>>>>>Open the third party plugin and pull out it's manifest.mf. This file
>>>>>>needs to be modified, so as to expose each java package that you want
>>>>>>other plugins to see. (There are other ways to accomplish this--look
>>>>>>up
>>>>>>buddies). In the mf file, you need to add:
>>>>>>
>>>>>>Export-Package: com.xxx.xxx.xxx1
>>>>>>
>>>>>>com.xxx.xx.xxx2
>>>>>>
>>>>>>com.xxx.xx.xxx3
>>>>>>
>>>>>>com.xxx.xx.xxx4
>>>>>>
>>>>>>.
>>>>>>
>>>>>>.
>>>>>>
>>>>>>.
>>>>>>
>>>>>>etc.
>>>>>>
>>>>>>
>>>>>>
>>>>>>This should be done for each pkg that needs to be exposed. If you
>>>>>>open
>>>>>>the mf in the eclipse mf editor, you can do this through a nice ui, by
>>>>>>selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>>>>>>
>>>>>>Hope this helps.
>>>>>>
>>>>>>
>>>>>>
>>>>>>Dennis
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>"ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in message
>>>>>>news:ea76gu$v77$1@utils.eclipse.org...
>>>>>>
>>>>>>
>>>>>>
>>>>>>>I use a third party product in my RCP application. The third party
>>>>>>>software
>>>>>>>is in a separate plugin consisting of the necessary jars, my
>>>>>>>application
>>>>>>>is
>>>>>>>in a second plugin. I do not have ths source of the third party
>>>>>>>software
>>>>>>>but
>>>>>>>I know for sure that they do a System.getProperty("java.class.path")
>>>>>>>in
>>>>>>>order
>>>>>>>to access a configuration file. So far so good.
>>>>>>>All is well when I run my application within Eclipse because in the
>>>>>>>"run
>>>>>>>dialog"
>>>>>>>I can set Bootstrap Entries to -Djava.class.path="<path>" and I can
>>>>>>>also
>>>>>>>set
>>>>>>>the PATH variable to native code libs in the "environment tab".
>>>>>>>
>>>>>>>My problem now starts when I export my project. Where can is set my
>>>>>>>java classpath
>>>>>>>and my PATH variable in an exported project? I tried osgi.dev entry
>>>>>>>in
>>>>>>>config.ini,
>>>>>>>it didn' work (maybe I got the syntay wrong).
>>>>>>>Can anybody help me with this. There must be a way because I cannot
>>>>>>>imagine I am
>>>>>>>the only person integrating "older" third party software requring
>>>>>>>java
>>>>>>>classpath.
>>>>>>>It works with Java Applications but I MUST work with Eclipse
>>>>>>>applications.
>>>>>>>
>>>>>>>I'm grateful for any hint,
>>>>>>>
>>>>>>>Christine
>>>>>>>
>>>>>>
>>>>>>
>
|
|
|
Re: Third party jars needing java.class.path in RCP application [message #453395 is a reply to message #453370] |
Fri, 28 July 2006 08:16 |
ChrisTina Lewin Messages: 10 Registered: July 2009 |
Junior Member |
|
|
Yep, I tried this and it seemed to work as when I logged out my classpath it
seemed ok.
But, since I think every plugin has it's own classpath my third party
software didn't get
the right classpath and failed.
Christine
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:eab0d8$qpe$1@utils.eclipse.org...
> Sorry its late in the evening after a hard working day. Now in readable
> English ;-)
>
> Is the lib you are using reading the value and afterwards constructs a
> fully qualified path from it then you can try setting the
> java.class.path like this:
>
> System.setProperty("java.class.path",System.getProperty("java.class.path ")+";"+"C:/myPath");
>
> This will not have any effect for classloaders.
>
> Tom
>
> Tom Schindl wrote:
>> Is the model only reading the value and constructs the Path afterwards
>> to fully qualify the file? It that's the case have you tried setting the
>> value at startup with something like this:
>>
>> System.setProperty("java.class.path",
>> System.getProperty("java.class.path")+";"+"C:/myPath");
>>
>> Tom
>>
>> ChrisTina Lewin wrote:
>>
>>>Hi Dennis,
>>>
>>>this I did, all packages of the third party software appear in the
>>>exported
>>>list of the runtime
>>>tab. I added the configuration file to the classpath list, so it IS in
>>>the
>>>plugins classpath.
>>>I have no problems running my project within eclipse because of my
>>>bootstrap
>>>entries in the run
>>>tab of eclipse. As soon as I export the project to create a product, I
>>>get
>>>the problem of "file
>>>not found" because my classpath entry is not there anymore.
>>>The key problem is that the third party software make a call to
>>>System.getProperties("java.class.pass")
>>>and expects the path to the darned config file which unfortunately it
>>>doesn't get.
>>>So your suggested entries didn't work, unfortunately :-(
>>>
>>>But thanks anyway,
>>>Christine
>>>
>>>
>>>"Dennis Park" <denpark@cisco.com> wrote in message
>>>news:ea8gtb$dck$1@utils.eclipse.org...
>>>
>>>
>>>>Oh yeah,
>>>>then reinsert the mf back into the plugin u extracted it from.
>>>>
>>>>
>>>>"Dennis Park" <denpark@cisco.com> wrote in message
>>>>news:ea8gqq$cc0$1@utils.eclipse.org...
>>>>
>>>>
>>>>>Open the third party plugin and pull out it's manifest.mf. This file
>>>>>needs to be modified, so as to expose each java package that you want
>>>>>other plugins to see. (There are other ways to accomplish this--look
>>>>>up
>>>>>buddies). In the mf file, you need to add:
>>>>>
>>>>>Export-Package: com.xxx.xxx.xxx1
>>>>>
>>>>>com.xxx.xx.xxx2
>>>>>
>>>>>com.xxx.xx.xxx3
>>>>>
>>>>>com.xxx.xx.xxx4
>>>>>
>>>>>.
>>>>>
>>>>>.
>>>>>
>>>>>.
>>>>>
>>>>>etc.
>>>>>
>>>>>
>>>>>
>>>>>This should be done for each pkg that needs to be exposed. If you open
>>>>>the mf in the eclipse mf editor, you can do this through a nice ui, by
>>>>>selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>>>>>
>>>>>Hope this helps.
>>>>>
>>>>>
>>>>>
>>>>>Dennis
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>"ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in message
>>>>>news:ea76gu$v77$1@utils.eclipse.org...
>>>>>
>>>>>
>>>>>>I use a third party product in my RCP application. The third party
>>>>>>software
>>>>>>is in a separate plugin consisting of the necessary jars, my
>>>>>>application
>>>>>>is
>>>>>>in a second plugin. I do not have ths source of the third party
>>>>>>software
>>>>>>but
>>>>>>I know for sure that they do a System.getProperty("java.class.path")
>>>>>>in
>>>>>>order
>>>>>>to access a configuration file. So far so good.
>>>>>>All is well when I run my application within Eclipse because in the
>>>>>>"run
>>>>>>dialog"
>>>>>>I can set Bootstrap Entries to -Djava.class.path="<path>" and I can
>>>>>>also
>>>>>>set
>>>>>>the PATH variable to native code libs in the "environment tab".
>>>>>>
>>>>>>My problem now starts when I export my project. Where can is set my
>>>>>>java classpath
>>>>>>and my PATH variable in an exported project? I tried osgi.dev entry in
>>>>>>config.ini,
>>>>>>it didn' work (maybe I got the syntay wrong).
>>>>>>Can anybody help me with this. There must be a way because I cannot
>>>>>>imagine I am
>>>>>>the only person integrating "older" third party software requring java
>>>>>>classpath.
>>>>>>It works with Java Applications but I MUST work with Eclipse
>>>>>>applications.
>>>>>>
>>>>>>I'm grateful for any hint,
>>>>>>
>>>>>>Christine
>>>>>>
>>>>>
>>>>>
>>>
|
|
|
Re: Third party jars needing java.class.path in RCP application [message #453397 is a reply to message #453380] |
Fri, 28 July 2006 09:06 |
ChrisTina Lewin Messages: 10 Registered: July 2009 |
Junior Member |
|
|
This does work up to a point as when I log my classpath in my application it
looks ok, but
some instance seems to overwrite the classpath of my third party plugin.
Seems my application
plugin gets the classpath from commandline options and the second third
party plugin doesn't.
The main question still is: What is to be done to achieve the same result in
an exported product
that I get by making a classpath entry in Bootstrap Entries of the Eclipse
Application Launcher
dialog "Run"?
Christine
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:eab4rf$g98$1@utils.eclipse.org...
>I experimented a little bit and think the problem is that when you are
> launching the application using eclipse.exe after exporting the
> application starts with java -jar this way only the startup.jar is in
> the class-path whereas when you run your application from within eclipse
> it is started not like this but similar to the lines below.
>
> But the starter is in fact a fairly dumb thing you could emulate your
> own by calling:
>
>> java -classpath startup.jar;C:/bla;My.jar
>> org.eclipse.core.launcher.Main -os win32 -ws win32 -arch x86 -launcher
>> eclipse -name Eclipse -showsplash 600 -exitdata 9000c -vm
>> java -vmargs -jar startup.jar
>
> Please note my own changes to the class-path: C:/bla;My.jar.
>
> I'm not sure what the values for -os and -ws are (because I ran it on
> linux) but the minum line looks like this:
>
>> java -classpath startup.jar;C:/bla;My.jar
>> org.eclipse.core.launcher.Main -launcher eclipse -name
>> Eclipse -showsplash 600
>
> Tom
>
> Tom Schindl wrote:
>> Sorry its late in the evening after a hard working day. Now in readable
>> English ;-)
>>
>> Is the lib you are using reading the value and afterwards constructs a
>> fully qualified path from it then you can try setting the
>> java.class.path like this:
>>
>> System.setProperty("java.class.path",System.getProperty("java.class.path ")+";"+"C:/myPath");
>>
>> This will not have any effect for classloaders.
>>
>> Tom
>>
>> Tom Schindl wrote:
>>
>>>Is the model only reading the value and constructs the Path afterwards
>>>to fully qualify the file? It that's the case have you tried setting the
>>>value at startup with something like this:
>>>
>>>System.setProperty("java.class.path",
>>>System.getProperty("java.class.path")+";"+"C:/myPath ");
>>>
>>>Tom
>>>
>>>ChrisTina Lewin wrote:
>>>
>>>
>>>>Hi Dennis,
>>>>
>>>>this I did, all packages of the third party software appear in the
>>>>exported
>>>>list of the runtime
>>>>tab. I added the configuration file to the classpath list, so it IS in
>>>>the
>>>>plugins classpath.
>>>>I have no problems running my project within eclipse because of my
>>>>bootstrap
>>>>entries in the run
>>>>tab of eclipse. As soon as I export the project to create a product, I
>>>>get
>>>>the problem of "file
>>>>not found" because my classpath entry is not there anymore.
>>>>The key problem is that the third party software make a call to
>>>>System.getProperties("java.class.pass")
>>>>and expects the path to the darned config file which unfortunately it
>>>>doesn't get.
>>>>So your suggested entries didn't work, unfortunately :-(
>>>>
>>>>But thanks anyway,
>>>>Christine
>>>>
>>>>
>>>>"Dennis Park" <denpark@cisco.com> wrote in message
>>>>news:ea8gtb$dck$1@utils.eclipse.org...
>>>>
>>>>
>>>>
>>>>>Oh yeah,
>>>>>then reinsert the mf back into the plugin u extracted it from.
>>>>>
>>>>>
>>>>>"Dennis Park" <denpark@cisco.com> wrote in message
>>>>>news:ea8gqq$cc0$1@utils.eclipse.org...
>>>>>
>>>>>
>>>>>
>>>>>>Open the third party plugin and pull out it's manifest.mf. This file
>>>>>>needs to be modified, so as to expose each java package that you want
>>>>>>other plugins to see. (There are other ways to accomplish this--look
>>>>>>up
>>>>>>buddies). In the mf file, you need to add:
>>>>>>
>>>>>>Export-Package: com.xxx.xxx.xxx1
>>>>>>
>>>>>>com.xxx.xx.xxx2
>>>>>>
>>>>>>com.xxx.xx.xxx3
>>>>>>
>>>>>>com.xxx.xx.xxx4
>>>>>>
>>>>>>.
>>>>>>
>>>>>>.
>>>>>>
>>>>>>.
>>>>>>
>>>>>>etc.
>>>>>>
>>>>>>
>>>>>>
>>>>>>This should be done for each pkg that needs to be exposed. If you
>>>>>>open
>>>>>>the mf in the eclipse mf editor, you can do this through a nice ui, by
>>>>>>selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>>>>>>
>>>>>>Hope this helps.
>>>>>>
>>>>>>
>>>>>>
>>>>>>Dennis
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>"ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in message
>>>>>>news:ea76gu$v77$1@utils.eclipse.org...
>>>>>>
>>>>>>
>>>>>>
>>>>>>>I use a third party product in my RCP application. The third party
>>>>>>>software
>>>>>>>is in a separate plugin consisting of the necessary jars, my
>>>>>>>application
>>>>>>>is
>>>>>>>in a second plugin. I do not have ths source of the third party
>>>>>>>software
>>>>>>>but
>>>>>>>I know for sure that they do a System.getProperty("java.class.path")
>>>>>>>in
>>>>>>>order
>>>>>>>to access a configuration file. So far so good.
>>>>>>>All is well when I run my application within Eclipse because in the
>>>>>>>"run
>>>>>>>dialog"
>>>>>>>I can set Bootstrap Entries to -Djava.class.path="<path>" and I can
>>>>>>>also
>>>>>>>set
>>>>>>>the PATH variable to native code libs in the "environment tab".
>>>>>>>
>>>>>>>My problem now starts when I export my project. Where can is set my
>>>>>>>java classpath
>>>>>>>and my PATH variable in an exported project? I tried osgi.dev entry
>>>>>>>in
>>>>>>>config.ini,
>>>>>>>it didn' work (maybe I got the syntay wrong).
>>>>>>>Can anybody help me with this. There must be a way because I cannot
>>>>>>>imagine I am
>>>>>>>the only person integrating "older" third party software requring
>>>>>>>java
>>>>>>>classpath.
>>>>>>>It works with Java Applications but I MUST work with Eclipse
>>>>>>>applications.
>>>>>>>
>>>>>>>I'm grateful for any hint,
>>>>>>>
>>>>>>>Christine
>>>>>>>
>>>>>>
>>>>>>
>
|
|
| |
Re: Third party jars needing java.class.path in RCP application [message #453404 is a reply to message #453395] |
Fri, 28 July 2006 13:12 |
Eclipse User |
|
|
|
Originally posted by: dittmar.steiner.web.de
yes, every plugin has it's own private classpath.
from a plugin created from jars it's hard to debug.
But i faced a strange bug (?) with eclipse/rcp 3.2:
if i let explod (unzip) the thirdparty jars, the build failes, if i let the the jars exist as jars, everything is fine.
a) did you unzip the jars? may be you better don't
b) is your configuration file within on of the jars?
if not, then create the required folder structure, add the config file and add the root folder to the manifest's classpath.
MANIFEST.MF:
Bundle-ClassPath: thirdparty01.jar,
thirdparty02.jar,
mycustomclasses/ <- folder that contains the packages with the config file (trailing slash? - i don't know)
Export-Package: .,
mycustomclasses/
...
hope this helps.
Dittmar
ChrisTina Lewin schrieb:
> Yep, I tried this and it seemed to work as when I logged out my classpath it
> seemed ok.
> But, since I think every plugin has it's own classpath my third party
> software didn't get
> the right classpath and failed.
>
> Christine
>
>
> "Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
> news:eab0d8$qpe$1@utils.eclipse.org...
>> Sorry its late in the evening after a hard working day. Now in readable
>> English ;-)
>>
>> Is the lib you are using reading the value and afterwards constructs a
>> fully qualified path from it then you can try setting the
>> java.class.path like this:
>>
>> System.setProperty("java.class.path",System.getProperty("java.class.path ")+";"+"C:/myPath");
>>
>> This will not have any effect for classloaders.
>>
>> Tom
>>
>> Tom Schindl wrote:
>>> Is the model only reading the value and constructs the Path afterwards
>>> to fully qualify the file? It that's the case have you tried setting the
>>> value at startup with something like this:
>>>
>>> System.setProperty("java.class.path",
>>> System.getProperty("java.class.path")+";"+"C:/myPath");
>>>
>>> Tom
>>>
>>> ChrisTina Lewin wrote:
>>>
>>>> Hi Dennis,
>>>>
>>>> this I did, all packages of the third party software appear in the
>>>> exported
>>>> list of the runtime
>>>> tab. I added the configuration file to the classpath list, so it IS in
>>>> the
>>>> plugins classpath.
>>>> I have no problems running my project within eclipse because of my
>>>> bootstrap
>>>> entries in the run
>>>> tab of eclipse. As soon as I export the project to create a product, I
>>>> get
>>>> the problem of "file
>>>> not found" because my classpath entry is not there anymore.
>>>> The key problem is that the third party software make a call to
>>>> System.getProperties("java.class.pass")
>>>> and expects the path to the darned config file which unfortunately it
>>>> doesn't get.
>>>> So your suggested entries didn't work, unfortunately :-(
>>>>
>>>> But thanks anyway,
>>>> Christine
>>>>
>>>>
>>>> "Dennis Park" <denpark@cisco.com> wrote in message
>>>> news:ea8gtb$dck$1@utils.eclipse.org...
>>>>
>>>>
>>>>> Oh yeah,
>>>>> then reinsert the mf back into the plugin u extracted it from.
>>>>>
>>>>>
>>>>> "Dennis Park" <denpark@cisco.com> wrote in message
>>>>> news:ea8gqq$cc0$1@utils.eclipse.org...
>>>>>
>>>>>
>>>>>> Open the third party plugin and pull out it's manifest.mf. This file
>>>>>> needs to be modified, so as to expose each java package that you want
>>>>>> other plugins to see. (There are other ways to accomplish this--look
>>>>>> up
>>>>>> buddies). In the mf file, you need to add:
>>>>>>
>>>>>> Export-Package: com.xxx.xxx.xxx1
>>>>>>
>>>>>> com.xxx.xx.xxx2
>>>>>>
>>>>>> com.xxx.xx.xxx3
>>>>>>
>>>>>> com.xxx.xx.xxx4
>>>>>>
>>>>>> .
>>>>>>
>>>>>> .
>>>>>>
>>>>>> .
>>>>>>
>>>>>> etc.
>>>>>>
>>>>>>
>>>>>>
>>>>>> This should be done for each pkg that needs to be exposed. If you open
>>>>>> the mf in the eclipse mf editor, you can do this through a nice ui, by
>>>>>> selecting the 'Runtime' tab, in the 'Export Pkgs' frame. \
>>>>>>
>>>>>> Hope this helps.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Dennis
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> "ChrisTina Lewin" <christine.lewin@wincor-nixdorf.ch> wrote in message
>>>>>> news:ea76gu$v77$1@utils.eclipse.org...
>>>>>>
>>>>>>
>>>>>>> I use a third party product in my RCP application. The third party
>>>>>>> software
>>>>>>> is in a separate plugin consisting of the necessary jars, my
>>>>>>> application
>>>>>>> is
>>>>>>> in a second plugin. I do not have ths source of the third party
>>>>>>> software
>>>>>>> but
>>>>>>> I know for sure that they do a System.getProperty("java.class.path")
>>>>>>> in
>>>>>>> order
>>>>>>> to access a configuration file. So far so good.
>>>>>>> All is well when I run my application within Eclipse because in the
>>>>>>> "run
>>>>>>> dialog"
>>>>>>> I can set Bootstrap Entries to -Djava.class.path="<path>" and I can
>>>>>>> also
>>>>>>> set
>>>>>>> the PATH variable to native code libs in the "environment tab".
>>>>>>>
>>>>>>> My problem now starts when I export my project. Where can is set my
>>>>>>> java classpath
>>>>>>> and my PATH variable in an exported project? I tried osgi.dev entry in
>>>>>>> config.ini,
>>>>>>> it didn' work (maybe I got the syntay wrong).
>>>>>>> Can anybody help me with this. There must be a way because I cannot
>>>>>>> imagine I am
>>>>>>> the only person integrating "older" third party software requring java
>>>>>>> classpath.
>>>>>>> It works with Java Applications but I MUST work with Eclipse
>>>>>>> applications.
>>>>>>>
>>>>>>> I'm grateful for any hint,
>>>>>>>
>>>>>>> Christine
|
|
| |
Goto Forum:
Current Time: Wed Oct 09 03:55:45 GMT 2024
Powered by FUDForum. Page generated in 0.07145 seconds
|