Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » PATH Environment Variable Needed
PATH Environment Variable Needed [message #462223] Wed, 24 January 2007 20:40 Go to next message
Eclipse UserFriend
Originally posted by: Dale.Larsen.ugs.com

I am trying to export my RCP product using the various Eclipse wizards and
have run into some difficulties.

The product runs successfully while within the Eclipse IDE because on the
Run configuration, you have the option of specifying Environment Variables.
In this tab, I specify the PATH variable to contain some locations (a bin
dir and a lib dir) that are needed by a third-party set of jars.

I have done a lot of reading up on passing in system properties (with
the -D) option to the JVM, but in my case I really need to have the PATH
environment set before running. There doesn't seem to be a mechanism to
take these environment variables from an Eclipse Run configuration out to
the product. I have launched my resulting RCP .exe file and have the
environment set correctly, but it seems to be ignored by the resulting
eclipse process.

I saw an older thread along these lines where somebody had a similar
question/issue, but also had some classpath questions. I never did see an
answer to this environment variable issue.

Any help would be appreciated.

Thanks,

Dale
Re: PATH Environment Variable Needed [message #462225 is a reply to message #462223] Wed, 24 January 2007 21:52 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
I don't believe that the standard Eclipse mechanism provides this. In any case, in Windows, once the PATH is set for the process (before it starts) it can't be changed inside the process.

Your best bet will be to have some kind of batch file that does the setup e.g.:

@echo off
set PATH=/path/to/bin/dir
start eclipse.exe

If you make it start minimized, you'll see a brief icon flash up and then go away again, since the 'start' brings up Eclipse in a new process; however, it inherits the container's environment.

You won't be able to do this inside the eclipse.exe, because the environment is frozen at that time.

May I ask why you need this? If the path contains native DLLs, you can package them up in a bundle, and get the native code to load that. One slight caveat; you need to load them up in dependency order, because if you have 'a.dll' which depends on 'b.dll', then it will work if you do System.loadLibrary("b");System.loadLibrary("a") but not the other way around. The reason is that when you load up a DLL in windows, windows will try and satisfy the dependencies for you. So if you were to load up "a", and it needed "b", then it would consult the PATH for "b". However, if you were to load up "b" first, then load up "a", the dependency ("b") is already loaded into memory and so it does not need to consult the PATH to resolve it.

There's a windows tool whose name I've forgotten -- depends.exe? -- which will tell you what the DLL depends on, and you can use that to determine the correct order.

PS if anyone has any DLL experience, and wants to help me, it should be relatively easy to do a setup such that it's possible to automatically determine the dependencies and do all of this ...

Alex.
Previous Topic:actionSetPartAssociations wont work to hide action set
Next Topic:the tab style of welcome page
Goto Forum:
  


Current Time: Mon Sep 16 18:53:51 GMT 2024

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

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

Back to the top