Re: Tomcat loading dlls
Please be careful with Nabble. You are resending your messages to the list [1] the third time in a row. Maybe there was some "OK" button that you were inadvertently pressing. Regarding Eclipse on Windows: 1. If you updated your PATH variable, any program that was started before the update will still see the old value of the variable. 2. You can System.getenv() to test what environment variables were actually used to start your Tomcat instance. 3. Chapter 11.2.3 Locating Native Libraries in [2] tells about how PATH is used for System.loadLibrary() on Windows, and how java.library.path property overrides that. [1] http://tomcat.apache.org/lists.html [2] http://java.sun.com/docs/books/jni/html/design.html Best regards, Konstantin Kolinko - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat loading dlls
> From: StrongSteve [mailto:ste...@starkeweb.org] > Subject: RE: Tomcat loading dlls > > > If a Java program calls System.loadLibrary("XXX"), are all directories > specified by the PATH varibale searched for a DLL called XXX? For Windows, yes, in the order specified on the PATH variable. For Linux, the LD_LIBRARY_PATH variable is used. Both are overridden by the java.library.path system property, if present. > Can anyone explain the difference between PATH, CLASSPATH and > java.library.path. PATH is where the OS searches for executables, and also where a Windows JVM searches for loadLibrary() references by default. Unless the java.library.path system property is explicitly set, the Windows Java launchers set it to the value of PATH. You may specify java.library.path on the command line to avoid the overhead of searching through PATH, which is often a rather long list, and might encounter DLL versions you didn't want to load. The CLASSPATH environment variable is a hold-over from the early days of Java, and really should never be used. It sets the default location for where the JVM should search for class files. Such a location should be specified on the command line via the -cp parameter or the java.class.path system property. (Apple should be ashamed of themselves for setting CLASSPATH in the system environment variables whenever QuickTime is installed or updated on Windows - that's extremely obnoxious behavior.) The use of CLASSPATH has caused an incredible amount of confusion and grief over the years. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat loading dlls
> From: StrongSteve [mailto:ste...@starkeweb.org] > Subject: RE: Tomcat loading dlls > > In order for it to work I have to append the directory to > the "library path" when starting the Tomcat from within Eclipse. > > Why is this so? Am I doing something wrong? I mean it is the same > Tomcat. No, it's not the same Tomcat. Eclipse insists on using its own configuration and startup scripts, ignoring whatever you've established for the standalone Tomcat. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Tomcat loading dlls
On 24/02/2010 10:16, StrongSteve wrote: Just one thing I forgot to ask. Using the PATH Variable works fine when starting the Tomcat from a command shell. Nevertheless if I start the Tomcat from within Eclipse (MyEclipse), it does not care if the directory is specified in the PATH or not. The DLL is not being loaded. In order for it to work I have to append the directory to the "library path" when starting the Tomcat from within Eclipse. Why is this so? Am I doing something wrong? I mean it is the same Tomcat. Just once started from within Eclipse. It's the same Tomcat installation, but Eclipse is very likely to be using it's own configuration files to launch it. You'll probably find some info about this in the Eclipse docs. p Thanks in Advance! Stefan StrongSteve wrote: Using the PATH Variable worked fine. Just some quick questions for a better understanding: If a Java program calls System.loadLibrary("XXX"), are all directories specified by the PATH varibale searched for a DLL called XXX? In case there are more directories specified that do contain a DLL called XXX, which one is taken? The first occurence specified in the PATH Variable, the last one? Can anyone explain the difference between PATH, CLASSPATH and java.library.path. I am a little stuck on when to use use which property. Thanks in Advance for your time! Greetings Stefan n828cl wrote: From: StrongSteve [mailto:ste...@starkeweb.org] Subject: Tomcat loading dlls Do I place the needed dlls into another directory and alter an environmental variable (f.e. java.library.path, PATH, CLASSPATH, ...) or do i alter catalina.bat/startup.bat? Since you're on Windows, the easiest approach is just to insure the DLLs are somewhere in the PATH - if you're running Tomcat from the .bat scripts. If you want to modify the PATH variable to include an additional directory, do that with setenv.bat; don't modify catalina.bat or startup.bat. If you're running Tomcat as a Windows service, set the java.libary.path system property in the Java tab of the tomcat?w.exe program to point to the directory where the DLLs are. (Fill in the ? with the level of Tomcat you're using - which you didn't tell us.) - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat loading dlls
Just one thing I forgot to ask. Using the PATH Variable works fine when starting the Tomcat from a command shell. Nevertheless if I start the Tomcat from within Eclipse (MyEclipse), it does not care if the directory is specified in the PATH or not. The DLL is not being loaded. In order for it to work I have to append the directory to the "library path" when starting the Tomcat from within Eclipse. Why is this so? Am I doing something wrong? I mean it is the same Tomcat. Just once started from within Eclipse. Thanks in Advance! Stefan StrongSteve wrote: > > Using the PATH Variable worked fine. > > Just some quick questions for a better understanding: > > If a Java program calls System.loadLibrary("XXX"), are all directories > specified by the PATH varibale searched for a DLL called XXX? In case > there are more directories specified that do contain a DLL called XXX, > which one is taken? The first occurence specified in the PATH Variable, > the last one? > > Can anyone explain the difference between PATH, CLASSPATH and > java.library.path. I am a little stuck on when to use use which property. > > Thanks in Advance for your time! > > Greetings > Stefan > > > n828cl wrote: >> >>> From: StrongSteve [mailto:ste...@starkeweb.org] >>> Subject: Tomcat loading dlls >>> >>> Do I place the needed dlls into another directory and alter an >>> environmental variable (f.e. java.library.path, PATH, CLASSPATH, >>> ...) or do i alter catalina.bat/startup.bat? >> >> Since you're on Windows, the easiest approach is just to insure the DLLs >> are somewhere in the PATH - if you're running Tomcat from the .bat >> scripts. If you want to modify the PATH variable to include an >> additional directory, do that with setenv.bat; don't modify catalina.bat >> or startup.bat. >> >> If you're running Tomcat as a Windows service, set the java.libary.path >> system property in the Java tab of the tomcat?w.exe program to point to >> the directory where the DLLs are. (Fill in the ? with the level of >> Tomcat you're using - which you didn't tell us.) >> >> - Chuck >> >> >> >> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY >> MATERIAL and is thus for use only by the intended recipient. If you >> received this in error, please contact the sender and delete the e-mail >> and its attachments from all computers. >> >> >> - >> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org >> For additional commands, e-mail: users-h...@tomcat.apache.org >> >> >> > > -- View this message in context: http://old.nabble.com/Tomcat-loading-dlls-tp27703944p27714139.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat loading dlls
Using the PATH Variable worked fine. Just some quick questions for a better understanding: If a Java program calls System.loadLibrary("XXX"), are all directories specified by the PATH varibale searched for a DLL called XXX? In case there are more directories specified that do contain a DLL called XXX, which one is taken? The first occurence specified in the PATH Variable, the last one? Can anyone explain the difference between PATH, CLASSPATH and java.library.path. I am a little stuck on when to use use which property. Thanks in Advance for your time! Greetings Stefan n828cl wrote: > >> From: StrongSteve [mailto:ste...@starkeweb.org] >> Subject: Tomcat loading dlls >> >> Do I place the needed dlls into another directory and alter an >> environmental variable (f.e. java.library.path, PATH, CLASSPATH, >> ...) or do i alter catalina.bat/startup.bat? > > Since you're on Windows, the easiest approach is just to insure the DLLs > are somewhere in the PATH - if you're running Tomcat from the .bat > scripts. If you want to modify the PATH variable to include an additional > directory, do that with setenv.bat; don't modify catalina.bat or > startup.bat. > > If you're running Tomcat as a Windows service, set the java.libary.path > system property in the Java tab of the tomcat?w.exe program to point to > the directory where the DLLs are. (Fill in the ? with the level of Tomcat > you're using - which you didn't tell us.) > > - Chuck > > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL and is thus for use only by the intended recipient. If you > received this in error, please contact the sender and delete the e-mail > and its attachments from all computers. > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > > -- View this message in context: http://old.nabble.com/Tomcat-loading-dlls-tp27703944p27714134.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Tomcat loading dlls
> From: StrongSteve [mailto:ste...@starkeweb.org] > Subject: Tomcat loading dlls > > Do I place the needed dlls into another directory and alter an > environmental variable (f.e. java.library.path, PATH, CLASSPATH, > ...) or do i alter catalina.bat/startup.bat? Since you're on Windows, the easiest approach is just to insure the DLLs are somewhere in the PATH - if you're running Tomcat from the .bat scripts. If you want to modify the PATH variable to include an additional directory, do that with setenv.bat; don't modify catalina.bat or startup.bat. If you're running Tomcat as a Windows service, set the java.libary.path system property in the Java tab of the tomcat?w.exe program to point to the directory where the DLLs are. (Fill in the ? with the level of Tomcat you're using - which you didn't tell us.) - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org