Home » Eclipse Projects » Rich Client Platform (RCP) » Third party jars needing java.class.path in RCP application
Third party jars needing java.class.path in RCP application [message #453319] |
Wed, 26 July 2006 03:44  |
Eclipse User |
|
|
|
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 #453325 is a reply to message #453322] |
Wed, 26 July 2006 08:12   |
Eclipse User |
|
|
|
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 #453339 is a reply to message #453338] |
Wed, 26 July 2006 15:47   |
Eclipse User |
|
|
|
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 04:31   |
Eclipse User |
|
|
|
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 14:21   |
Eclipse User |
|
|
|
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 14:24   |
Eclipse User |
|
|
|
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 15:40   |
Eclipse User |
|
|
|
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 19:19   |
Eclipse User |
|
|
|
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 03:51   |
Eclipse User |
|
|
|
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 03:55   |
Eclipse User |
|
|
|
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 04:16   |
Eclipse User |
|
|
|
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 05:06   |
Eclipse User |
|
|
|
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 09: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
|
|
|
Re: Third party jars needing java.class.path in RCP application [message #453559 is a reply to message #453399] |
Wed, 02 August 2006 10:56  |
Eclipse User |
|
|
|
Starting via command line it works fine, but does anybody also know how to
start the whole thing
using Eclipse.ini?
My MyProg.ini looks like this:
-vm c:\Progra~1\java\jre1.5.0_06\bin\java.exe
-os win32
-arch x86
-ws win32
-launcher c:\temp\MyProg\MyProg.exe
-name MyProg
-startup c:\temp\MyProg\startup.jar
-debug
-vmargs
-Xms256m
-Xmx512m
-Xbootclasspath/p:c:\temp\MyProg\myconfig
....but is doesn't work. The Xbootclasspath seems to be evaluated, but the
CLASSPATH is only set to
c:\temp\MyProg\startup.jar. If I set -classpath or -osgi.dev or -dev to my
required config file,
the entry seems to get ignored.
Cheers,
Christine
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:eacmqh$viv$1@utils.eclipse.org...
> This is the full command line in eclipse uses to launch a product:
>
>> /usr/java/jdk1.5.0_02/bin/java -classpath
>> /opt/eclipse/3.2-final/startup.jar:Test.jar
>> org.eclipse.core.launcher.Main -launcher
>> /opt/eclipse/3.2-final/eclipse -name Eclipse -showsplash 600 -product
>> at.bestsolution.membersadmin.oeushmembers -data
>> /home.local/tom/projects/eclipse-ws/oeush-admin/../runtime-M embers.product
>> -configuration
>> file:/home.local/tom/projects/eclipse-ws/oeush-admin/.metada ta/.plugins/org.eclipse.pde.core/Members.product/ -
>> dev
>> file:/home.local/tom/projects/eclipse-ws/oeush-admin/.metada ta/.plugins/org.eclipse.pde.core/Members.product/dev.propert ies -
>> os linux -ws gtk -arch x86
>
> There's only one occurence of the entry added to Bootstrap-Entries
> exactly where I put it in my last example.
>
> Tom
>
> ChrisTina Lewin schrieb:
>> 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
>>
>>
|
|
|
Goto Forum:
Current Time: Wed Jul 02 06:17:19 EDT 2025
Powered by FUDForum. Page generated in 0.19186 seconds
|