classpath

How to add /usr/share/java libs to webapp's classpath?

Summary Is that possible for webapps deployed on linux + tomcat5.5 to use/see all /usr/share/java/ jars automatically? Details I'm packaging my java webapp for Ubuntu (yet the question is related to any linux-based distro) and going to make it depend on tomcat. I'm going to put context descriptor (an xml file) to /usr/share/tomcat5.5...

JAXB 2 in an Oracle 10g Webapp

I have a web application that uses JAXB 2. When deployed on an Oracle 10g app server I get errors as soon as I try to marshal an XML file. It turns out that Oracle includes JAXB 1 in a jar sneakily renamed "xml.jar". Does anyone know how I can force my webapp to use the version of the jaxb jars that I deployed in web-inf/lib over that...

How can I discover resources in a Java jar with a wildcard name?

I want to discover all xml files that my ClassLoader is aware of using a wildcard pattern. Is there any way to do this? ...

"loader constraints violated when linking javax/xml/namespace/QName class" from webapp on Oracle 10g

We have a web application that can be deployed on many application servers, including Oracle 10g. On that platform, however, we are having classpath issues. The webapp uses JAXB 2, but Oracle 10g ships with JAXB 1, and this was causing errors. To get around those we configured Oracle to prefer classes in our webapp, but now we are get...

Is there a tool to discover if the same class exists in multiple jars in the classpath?

If you have two jars in your classpath that contain different versions of the same class, the classpath order becomes critical. I am looking for a tool that can detect and flag such potential conflicts in a given classpath or set of folders. Certainly a script that starts: classes=`mktemp` for i in `find . -name "*.jar"` do echo "...

How to configure Caucho Resin's Java classpath to the system's library directory

I have a folder, '/var/unity/conf' with some properties files in it, and I'd like the Caucho's Resin JVM to have that directory on the classpath. What is the best way to modifiy resin.conf so that Resin knows to add this directory to the classpath? ...

Linking an external .jar from an Xcode java project?

How do I link an external .jar into my Xcode java project? That is, have it in the classpath during compilation and execution. I'm using Xcode 3.0 and this seems to have changed since 2.4. ...

Classpath including JAR within a JAR

Is it possible to specify a Java classpath that includes a JAR file contained within another JAR file? ...

How to add jars dynamically with jython embedded in Tomcat app?

I want to let the users of my app, which is in turn an app container (app contains subapps), add java jars to their jython path. I let the subapp managers write thir own extensions in jython, but some of the functionality they want to add needs additional jars. For example, if they want to check a svn repo, they need the svn access jars...

How do I increase the /proc/pid/cmdline 4096 byte limit?

For my Java apps with very long classpaths, I cannot see the main class specified near the end of the arg list when using ps. I think this stems from my Ubuntu system's size limit on /proc/pid/cmdline. How can I increase this limit? ...

How to set a long Java classpath in MSDOS/Windows?

I'm trying to run a particular JUnit test by hand on a Windows XP command line, which has an unusually high number of elements in the class path. I've tried several variations, such as: set CLASS_PATH=C:\path\a\b\c;C:\path\e\f\g;.... set CLASS_PATH=%CLASS_PATH%;C:\path2\a\b\c;C:\path2\e\f\g;.... ... C:\apps\jdk1.6.0_07\bin\java.exe -cl...

How to remove classpath variables from WAS module

On our Dev box, our application module contains references to the file:/apps/WebSphere61/systemApps/isclite.ear/ jar files and classpath entries. On our Prod box, however, it only contains the jar file containing all of our required classes. On Dev, this is causing a problem when using apache-commons-fileuploader as these classes are a...

Setting multiple jars in java classpath

Is there a way to include all the jar files within a directory in the classpath? I'm trying java -classpath lib/*.jar:. my.package.Program and it is not able to find class files that are certainly in those jars. Do I need to add each jar file to the classpath separately? ...

Eclipse class version bug

In eclipse 3.4 I'm trying to do some performance tests on a large product, one of the included libraries is the vecmath.jar (javax.vecmath package) from the Java3D project. Everything was working fine and then when trying to run it yesterday I get this exception/error not long after starting it up: java.lang.UnsupportedClassVersionErro...

Find where java class is loaded from

Does anyone know how to programmaticly find out where the java classloader actually loads the class from? I often work on large projects where the classpath gets very long and manual searching is not really an option. I recently had a problem where the classloader was loading an incorrect version of a class because it was on the clas...

NoClassDefFoundError while trying to run my jar with java.exe -jar...what's wrong?

I have an application that I'm trying to wrap into a jar for easier deployment. The application compiles and runs fine (in a Windows cmd window) when run as a set of classes reachable from the CLASSPATH. But when I jar up my classes and try to run it with java 1.6 in the same cmd window, I start getting exceptions: C:\dev\myapp\src\co...

How do you change the CLASSPATH within Java?

How do you change the CLASSPATH of a Java process from within the Java process? Before you ask me "Why would you want to do that?" I'll explain it shortly. When you have a Clojure REPL running it is common to need more jars in your CLASSPATH to load a Clojure source file, and I'd like to do it without having to restart Clojure it...

How do I auto load a database jar in Groovy without using the -cp switch?

I want to simplify my execution of a Groovy script that makes calls to an Oracle database. How do I add the ojdbc jar to the default classpath so that I can run groovy RunScript.groovy instead of groovy -cp ojdbc5.jar RunScript.groovy ...

Controlling the classpath in a servlet

My servlet application includes a number of library .jars, some of which contain embedded log4j.xml or log4j.properties files. I'd like to ensure that log4j finds my log4j.xml first! I've tried searching for some specification of the priorities of the various classpath elements in a servlet (e.g. does WEB-INF/classes always precede WEB-I...

Why System.setProperty() cannot change the classpath at run time !

I am refering to the question on changing the classpath programmatically. I read and found out that there is some function under System class as getproperties where we can retrieve the properties and then also can set it using setProperties(). The answers however I got was that It Wont work. I have not tried this myself, however, i am ...