classpath

Jar file dependencies in Java 1.4

I'm working on a small Java project that now connects to a MS SQL Server 2000 database, but will be shortly connecting to MS SQL Server 2005 database. I'm creating a single jar for ease of deployment. I was trying to set it up so I could just change a configuration file and change drivers (as I would in .NET). However, because of the ...

Jar placement for Web Apps using WebLogic

This seems like an elementary question, but I want to make sure that we're doing things right. We're making webapps using Spring MVC and serving them using WebLogic. Where should jars be placed in this setup? We have talked about placing business logic into jars that would live in the server classpath and app-specific jars would be pac...

Eclipse: How to prevent an entire rebuild of a project after changing classpath

Is there away to prevent eclipse from rebuilding the entire project every time I change an entry in the class path. Unfortunately, I have to play around with the build path often and rebuilding the projects takes a long time (easily 20-30 mins). Is there away to avoid this? ...

Netbeans 6.7 custom variable for ant task

Hi there! I've got a problem which I couldn't solve for a few days, please help me. I'd like to execute an ant-script within netbeans. the script needs a special classpath which a plugin/module made by myself puts into a "global-variable". The variable can be shown using the netbeans "Manage variables"-dialog. So it's working, I guess ...

Eclipse Build Path Exclusions/Inclusions

Following the advice in this link, Eclipse, classpath and subversion, I have setup my Eclipse project to ignore the Subversion directory. However, I cannot seem to find where those settings are actually stored. I want to be able to check them into a repository so, when I move to another computer, I (or a team) will have the settings in...

Are there any Java-compilers that leverage an OSGi-environment instead of using the classpath?

Are there any ways to make javac use an existing OSGi-environment for the resolution of build-time dependencies instead of setting the classpath explicitely? I know I could write an OSGi-component that uses the Compiler-API of the JDK, but I think there should be a more straightforward solution. Alternatively, if no such extension is av...

JavaMail ClassNotFound

I've run in to a strange error with the javamail 1.4.2 api and jdk/jre 1.6.0u16. I've placed the unzipped javamail-1.4.2 folder (along with the MySQL Connector-J 5.1.7 also needed) in both the jdk and jre folders as in the %classpath% below. .;"C:\Program Files\Java\jdk1.6.0-16\jre\lib\ext\mysql-connector-java-5.1.7-bin";"C:\Progra...

Are Java Class Paths First in First Searched?

I had a question about Java Class Path variables. If I have multiple jars with the same classes, which one does the jvm use at runtime. The first one listed in the Class Path, the last one, or is undefined? Thanks ...

Is there a customizable class loading order using ant junit task?

Hello, in our web-app project, we include some jar files. For patching some issues of one of the classes in a jar file, we changed the implemention of this class in a patches source folder. Since there is a defined class loading order in tomcat (WEB-INF/classes before WEB-INF/lib), the patched version of the class is loaded by tomcat, ...

How to handle two jar files in java?

I am using Netbeans IDE for a java project. In this project i need a jar file "htmlunit-2.6.jar". I have included this jar file in the project libraries folder. I have instantiated one of its class "WebClient" but this class needs other classes of "commons-httpclient-3.1.jar" file. Now I have also included "commons-httpclient-3.1.jar" ...

Eclipse+Maven compile problem

Hello, currently, I am developing web-apps using Eclipse. The build is done using Maven. The problem is that during compile time Eclipse is showing a lot of errors since there are a lot of missing jars. The final result is OK since the Maven is responsible for fetching these jars. How can make the eclipse not fail the compilation? I kn...

Junit and Java classpath woes - OS X

I'm trying to run the sample tests that come with junit4.7 and having some difficulty. java is respecting my CLASSPATH: me@dinosaurhunter ~/Desktop> export CLASSPATH= me@dinosaurhunter ~/Desktop> echo $CLASSPATH me@dinosaurhunter ~/Desktop> java junit.textui.TestRunner junit.samples.AllTests Exception in thread "main" java.lang.NoClas...

Classpath for custom Solr Transformer

I have written a custom Transformer subclass for the Solr DataImportHandler. It is in a jar file, but I can't figure out how to get solr to find it. java.lang.NoClassDefFoundError: org/apache/solr/handler/dataimport/Transformer I've configured the data-config.xml file with the full path to the custom transformer: transformer=...

Deploying ojdbc14.jar in a code module for a FileNet code module

Hi everybody, I'm trying to deploy a couple of jar files in a code module for an event action in FileNet P8 4.0 (the FileNet server runs on WebSphere 6.1). One of these jars is my custom code, and the other jar is the thin driver for Oracle called ojdbc14.jar (I also tried with ojdbc15.jar), the custom code uses the oracle jar in order ...

What is the difference between NoClassDefFoundError and ClassNotFoundException ?

I want to know the difference between the specified error and the exception. What is the reason for getting each of them and any thought process on how to deal with such errors? While working on a project. If we are modifying the existing code to include the new jar file I get to face these exceptions. Sometimes they will come in clien...

How to really read text file from classpath in Java

Hi All I am trying to read a text file which is set in CLASSPATH system variable. Not a user variable. I am trying to get input stream to the file as below: Place the directory of file (D:\myDir)in CLASSPATH and try below: InputStream in = this.getClass().getClassLoader().getResourceAsStream("SomeTextFile.txt"); InputStream in = this...

java.util.MissingResourceException when running a jar

Hi All, In order to internationalise my code, I use a property file called MessagesBundle_en_UK.properties which is located in a resource folder called config so that I the following structure: +---src \---com \---proj \---messages Messages.java +---config \-...

Java : loop on all the classes in the classpath

Is there a way to iterate over all the classes in the classpath ? I want to make some reflective checks on some classes implementing a certain interface, but I want to do it completely dynamically, without any input on which classes to check, just browsing the classpath. ...

How to read resource file from classpath in BlackBerry app?

Hi, I need to read a resource file from classpath in my BlackBerry application. The directory structure of my project is pretty common: under src directory there are 2 child dirs, one represents source packages root, another - resources root. When I try to read any resource from classpath Class.getResourceAsStream method retures null ...

How to set javadoc path for a jar in a projet using Eclipse

I'm using JUnit 3 in Eclipse Galileo. The junit.jar (located in the project in vendor/lib/) contains both the classes and the javadoc. In my project which I share using CVS, I want the doc to be available for everybody who checks-out the project. So I committed the .classpath file. When adding the javadoc path to the lib using the Eclip...