views:

46

answers:

3

Hello

I'm a beginner java developer and i'm not very confident with java world tools.

i'm using eclipse helios, jsdk 1.5, axis2 plugin and tomcat 6.0.29 on windows to port a very old webservice , preaviosuly deployed on a websphere. I've added a tomcat server to my eclipse project, when i start the server i get the following message : the APR based Apache Tomcat Native library ... etc ... was not found on the java.library.path . How do i change that variable (or any environment variable in general ) from inside eclipse ?

Then i've another problem i don't know if can be solved with some kind of configuration : i must use some third party .class library grouped togheter into a zip file. I've added the zip to the shared.loader property of the tomcat catalina.properties file and my project can't see them. If i rename the .zip file to .jar everything works fine . How can i use classes inside zip file without renaming it to jar ?

thank you in advance

+1  A: 

A Jar is based on the same format as that of Zip. All the third party classes are bundled as Jars (Java Archives) and should be used like that instead of Zip. So if you happen to have a zip housing your classes you should rename it to jar as per java's conventions.

Faisal Feroz
finally i've found that tomcat ignores .zip archive, the following link (tomcat 5.5 ) explains it for oracle driver : there's no better solution than rename the .zip file to .jar : http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html
Stefano
A: 

You can check where java.library.path variable is pointing to? using System.getProperty("java.library.path"); and see if the native libs are present in there..you should use the jar instead as its the standard format for archiving java class files

hakish
thank you for your answer, but i don't need to know what my variable points to, i wish to know how to setup this kind of variables(add/remove entries) from inside eclipse IDE . For example i know that i can set jvm custom arguments, for that project only, by adding a -Dsomething to the jvm arguments of the tomcat. Where do i find the java.library.path variable (for example) in the ide views or perspectives ?
Stefano
A: 

when i start the server i get the following message : the APR based Apache Tomcat Native library ... etc ... was not found on the java.library.path

The exact message is:

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path

As you can see, the message is logged as INFO and the easiest thing would be to ignore it, especially in a development environment. But if want to make things more complicated, go to the Apache Portable Runtime (APR) based Native library for Tomcat and follow the install instructions.

(...) I've added the zip to the shared.loader property of the tomcat catalina.properties file and my project can't see them. If i rename the .zip file to .jar everything works fine . How can i use classes inside zip file without renaming it to jar?

In other words, using a (standard) *.jar worked, but a *.zip didn't. I'm tempted to answer: use a .jar extension.

Pascal Thivent
hello thank you for your answer, but changing the extension from .zip to .jar is what i want to avoid. It is a set of packed classes which comes with a third party installation (ibm db2 i think), so i can't repack classes into a jar, and i don't think system administrators will be happy to copy and rename it. So the problem is : in java there's a way to use that classes into my project without renaming the file to jar ?
Stefano