classpath

How can I programmatically find the full path of the main executing class.

I'm trying to local a properties file programmatically without having to pass it's fullpathname on the commandline to my program. I figure if I can locate the path of the main class, I can stick my properties file in the same directory or a sub-directory. If that won't work is there some other way I can locate the path of a properti...

Classpath problems with Jini ClassDep, Java's dependency finder

I started to use Sun's ClassDep as a solution to fight the inclusion of unnecessary JARs in my resulting WAR application. It seems to rock. However, this beast is hard to tame! I'm getting several errors of classes not found even if they are explicitly included in the classpath I pass to it. Example: couldn't find: org.apache.log4j.Log...

how to build GNU Classpath and JamVM

I'm trying to build GNU Classpath 0.98 and JamVM 1.5.2. Following the JamVM readme, I did 'configure; make; make install' on the jamVM, and it worked. I then added jamvm and Sun javac to the path. Then with GNU Classpath I did this: ./configure --enable-jni --disable-gtk-peer --disable-gconf-peer --disable-plugin I got this error: Th...

How to walk through Java class resources?

I know we can do something like this: Class.class.getResourceAsStream("/com/youcompany/yourapp/module/someresource.conf") to read the files that are packaged within our jar file. I have googled it a lot and I am surely not using the proper terms; what I want to do is to list the available resources, something like this: Class.class....

Classpath validation in ant

I have a <path id="..."> in my build.xml. Before invoking the compiler I want to verify that every jar/directory on the classpath exists and print a warning with the missing ones. Does anybody know an existing solution or do I need to write my own task for that? OK, I decided to go for a custom task. Here it is, in case anybody eve...

Running Nightly Builds as XP Scheduled Task - Classpath Issue

I'm running JUnit nightly builds on my computer as a scheduled task in Windows XP. My application uses Jaxb, therefore some of the tests need to reference xsd schemas using the system classpath. When the nightly build runs while I'm not on the computer, I get an error like this: java.lang.Exception: Unable to load schema mySchema.xsd ...

What's the difference between CLASSPATH "bootstrap entries" and "user entries" in Eclipse?

Eclipse has a Run Configurations screen with a Classpath tab. I had some jars listed in the "user entries" section of this tab but my project did not run until I duplicated those jar files into the "bootstrap entries" section. After the jars were listed in both sections, the project ran successfully. Why? What's the difference betwe...

Setting the a Property to what maven.compile.classpath Contains WITHOUT Ant

Hi, I'd like to set a property in my pom to a classpath containing all the project's dependencies. The ant plugin does something like this, so I know it's definitely possible. I basically want to use ${maven.compile.classpath} wherever I like in my pom and have it 'just work'. I don't mind using plugins or anything else to achieve this...

Load Java classes based on a classpath in a properties file

My application uses JDBC database drivers. I load these from a jar file, db2jcc.jar in the case of DB2 which I'm currently working with. With this jar in the classpath, everything is fine, but I have a requirement to find the jar from a property in the application's config file instead - for example, database.driver=/opt/IBM/db2/V9.5/j...

Cyclic dependency of two eclipse projects

Hello! I am trying to implement some sort of MVC in Java. Actually it's more of a MVP but this doesn't really matter to my problem. Following situation: I've got a GUI, made with Netbeans (because of the better GUIeditor) which is updated and changed frequently. As my main project is easier to maintain in Eclipse I chose to import the...

Setting up java3d on os x leopard

I have recently installed OS X on my MBP and am wanting to set up java3d on it. I have set this up on windows which proved a lot easier with the installer provided. the mac install instructions can be found here: http://inverse.chi.googlepages.com/README-unzip.html I have placed both the j3d and jogl libs in my home directory /Users/ma...

Flex: Reuse classes for multiple projects without copy+paste?

OK I have a few classes I have made or found on the web that I plan to use in multiple projects, I would rather store these classes in a central location instead of copy+pasting them into each project. my Flex projects have their own workspaces inside the path Flex/WorkSpaces/< workSpaceName > If I wanted to put another folder inside t...

Maven classpath order issues

Hi, Does anyone know of a way to set a specific classpath order in Maven2, rather than the random ordering I appear to experience at the moment? There are a number of legitimate reasons for wanting to do this: A vendor has supplied a patch jar, which contains overriding classes for a previously released jar and therefore the patch ja...

Is WEB-INF in the CLASSPATH?

Is the WEB-INF file in the CLASSPATH of a Java Web application? ...

Classpath issue using XPathFactory

I keep getting the following exception on one of our live servers (the others running the same code seem ok): java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/domwith the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryCon...

Problem with paths in a java jar.

I have a folder called Etc which has an image I want to use in another file in the same folder, Example.java. So I have Etc\image.png and Etc\Example.java. I've tried using "Etc/image.png" as the image path, but that didn't work. How should I go about this? Also, suppose the files were in different packages, how would I do it? My main ...

Eclipse and Classpath.

I swear I'm going insane. JDeveloper runs my project with not a single complaint. If I do "java -cp /usr/share/java/mysql.jar:. MAIN.java", it works like a charm. But Eclipse says "[censored] you" and ignores my classpath settings. I open the Run > Run... menu, and add the mysql jar in the classpath tab, but time and time again, I ke...

How do you configure GroovyConsole so I don't have to import libraries at startup?

I have a groovy script that uses a third party library. Each time I open the application and attempt to run my script I have to import the proper library. I would like to be able to open GroovyConsole and run my application without having to import the library. ...

How best to add UNC file paths to a Java Classpath

Using Java (1.4) is there a way in which to use Windows UNC file locations (\\servername\filestore\etc) within the classpath? ...

How to parse and interpret ant's build.xml

Is there an Ant API for reading and ant build.xml and retrieving elements from it? Specifically I want to be able to retrieve the values in a path element and be able to walk all of the elements in the path. My purpose is to retrieve a given path and ensure that it is referenced correctly in a manifest, so that the build and the manifes...