Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Eclipse RCP product - is there anyway to update the PATH during launch(Want to update the System PATH to make sure my product's native binaries are loaded)
icon4.gif  Eclipse RCP product - is there anyway to update the PATH during launch [message #875518] Tue, 22 May 2012 22:23 Go to next message
ALOK MANJREKAR is currently offline ALOK MANJREKAR
Messages: 12
Registered: May 2012
Junior Member
Hello,

I am working on an eclipse RCP product on windows which internally uses some native binaries (dlls) located in a folder called "bin" which would be available as a part of the product. I need to make sure that the folder "bin" is present in the PATH when the product.exe file is executed. Is there a clean way to make sure that the folder "bin" is added to PATH when the eclipse RCP product is launched? I don't want to write any script or batch file that updates the PATH and then calls the product.exe. I also don't want to update the environment variable through the windows UI or command prompt.

I know that when we try to run my product from the eclipse IDE environment, there is an option in the run-configuration, wherein one can configure Environment variables on the Environment tab. I can append the "bin" folder to the PATH by creating a new environment variable called "Path" whose value is C:\EclipseRCPProduct\bin;${env_var:PATH}.

However - I would like to do the same when I run my product directly from the Product.exe which is generated. Does anyone have any idea regarding this?

Also - if anyone has any idea regarding the eclipse code which processes the information specified on the Environment tab of the run configuration, it would be great. I could try playing around with the code to see if I could get it to work when the product is launched from outside eclipse IDE - via the generated RCP product.exe
Re: Eclipse RCP product - is there anyway to update the PATH during launch [message #875722 is a reply to message #875518] Wed, 23 May 2012 08:25 Go to previous messageGo to next message
Libor Jelinek is currently offline Libor Jelinek
Messages: 143
Registered: January 2012
Location: Prague, Czech Rep.
Senior Member

There may be at least two approaches:

1) Use Bundle-ClassPath
Plug-in that needs to see bin/ folder can make use of MANIFEST.MF header
Bundle-ClassPath. Example:

Bundle-ClassPath: .,
bin/
other-folder/,
somelibrary.jar

Easier way to set it up is on "Classpath" section on Runtime tab of
Plug-in Manifest Editor.

2) Use VM arguments of product definition
Add standard -cp argument to "VM Arguments" section in Launching tab of
Product Configuration Editor.

I've never used this and probably it will replace global JVM
classpath... You have to prove it yourself.

Cheers
Libor


On 05/23/2012 12:23 AM, ALOK MANJREKAR wrote:
> Hello,
>
> I am working on an eclipse RCP product on windows which internally uses
> some native binaries (dlls) located in a folder called "bin" which would
> be available as a part of the product. I need to make sure that the
> folder "bin" is present in the PATH when the product.exe file is
> executed. Is there a clean way to make sure that the folder "bin" is
> added to PATH when the eclipse RCP product is launched? I don't want to
> write any script or batch file that updates the PATH and then calls the
> product.exe. I also don't want to update the environment variable
> through the windows UI or command prompt.
>
> I know that when we try to run my product from the eclipse IDE
> environment, there is an option in the run-configuration, wherein one
> can configure Environment variables on the Environment tab. I can append
> the "bin" folder to the PATH by creating a new environment variable
> called "Path" whose value is C:\EclipseRCPProduct\bin;${env_var:PATH}.
>
> However - I would like to do the same when I run my product directly
> from the Product.exe which is generated. Does anyone have any idea
> regarding this?
>
> Also - if anyone has any idea regarding the eclipse code which processes
> the information specified on the Environment tab of the run
> configuration, it would be great. I could try playing around with the
> code to see if I could get it to work when the product is launched from
> outside eclipse IDE - via the generated RCP product.exe
>
Re: Eclipse RCP product - is there anyway to update the PATH during launch [message #876688 is a reply to message #875722] Fri, 25 May 2012 05:38 Go to previous message
ALOK MANJREKAR is currently offline ALOK MANJREKAR
Messages: 12
Registered: May 2012
Junior Member
Thanks for your reply.
But at this stage it does not seem like a viable solution.
The product has more than 100 plugins. A lot of plugins have dependency on native binaries that are located in a folder called bin, which is to be installed along with the product, and located outside the plugins folder.
Is there a way I can append the bin folder to the System Path, when the product is being launched after double-clicking the product.exe.
In general does eclipse expose anyway of doing it similar to how we set/alter environment variables from the environment tab of the run-configuration while running the product from within the eclipse environment?
Previous Topic:com.ibm.rcp.ui dependency and com.ibm.rcp.ui.shelfview missing
Next Topic:Bit9 Parity Agent and RCP apps
Goto Forum:
  


Current Time: Fri Sep 19 04:00:45 GMT 2014

Powered by FUDForum. Page generated in 0.06133 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software