classpath

Java Library and Class Path Problems

Quick personal background: I was hired a few months ago as the sole .NET developer (C#) by a company whose other devs are all php devs. A week into the job I was told they wanted to switch to Java instead of doing .NET. Not an ideal situation, but I'm trying to make it work. I don't think I understand the relation between a project's li...

clojure rmi classpath problem

Hi, I am trying to use clojure to implement a "plugin" for some vendor supplied software. Here is a little background on the vendor supplied software. It expects me to implement a particular interface and then put the jar file containing that implementation into a directory on its server. Then when a client runs the software, my imple...

Downloading JAR files at runtime in Java

I am wondering if it is possible to have a Java desktop application, on startup, look to some URL, to see if it needs an update, and if so download necessary JAR files, and add them to classpath for the running program. If the old jars are there, they shouldn't have been loaded into the classloader yet, at this point should they? Is ...

Running jar from different directory cannot find required dependency

I'm trying to run a jar ec/mobat/MOBAT.jar which depends on some jars located in ec/mobat/lib/. It works if I do: ec/mobat/$ java -jar MOBAT.jar However I want to be able to run the jar from another directory ec/$ java -jar mobat/MOBAT.jar But I get an exception java.lang.NoClassDefFoundError: ibis/io/Serializable ... I tried to...

CLASSPATH, Java Buld Path (eclipse), and WEB-INF\LIB : what to use, when, and why?

Hello all, I recently switched to J2EE from .NET, and am confused about where to put JAR files. I know that the CLASSPATH, WEB-INF, and Eclipse's Java Web Path are all places where JARs can be stored, but I'm confused about which folder to use, when, and why. First off, we have the CLASSPATH. I usually set this by going into "Environ...

NetBeans IDE 6.7.1 Ant Script variables

How do I get the location of rt.jar in my Ant script with NetBeans without editing my project.properties? ${java.home} is returning the location of the jre folder and not the jdk folder. I know that I could easily add a value to project.properties but I don't want to. I also know that I could easily just modify the path whenever I switc...

How to configure grails classpath in order to add "src/groovy" folder ( in Linux environment)?

Hi, I am currently porting my development environment from Windows to Linux. Under Linux, I noticed a "No class found" compilation error related to my classes in the directory <PROJECT_HOME>/src/groovy. Under windows, it works fine. Is this "src/groovy" directory included in the CLASSPATH when running "grails run-app" ? Why does it ...

Java error: Only a type can be imported. XYZ resolves to a package.

I get the error: "Only a type can be imported. XYZ resolves to a package." Someone has explained the cause here but I am not sure what I supposed to do to fix this. FYI: I am using Eclipse. I have added the code that does the importing below. The java.util.* import works fine. <%@ page import="java.util.*"%> <%@ page import="org.ivec...

database connectivity?

How to establish SQL 2005 database connectivity with Java application. Actually I don't know how to set path for JDBC. Any help would be great. ...

Problem with Apache Commons Id UUID Version 1 generation

My problem is to generate version 1 UUIDs. We use Jetty 6.x, Maven (to start Jetty among other things) and Apache Commons ID (to generate UUID version 1 from the current time). Apache Commons ID requires a configuration file that is told to the JVM, using a parameter, e.g. 'org.apache.commons.id.uuid.config.resource.filename=commons-id-...

Using alternative of Library loaded by Java Bootstrap class loader

I need use the both jars local_policy.jar and US_export_policy.jar with unlimited key size strength. The JRE comes bundled with versions of the jars, with limited key size strength. But I can't replace the original jars in the $JAVA_HOME/lib/security (insufficient rights), so i need them to override (at runtime?) somehow. Any ideas? ...

Is it possible to have the System ClassLoader load .class files specified at run time?

I am writing a static analysis tool for an assignment, it analyses Java bytecode using the ASM library. One of the parts of ASM that we use requires (or at least, appears to require) that the class be loaded from the ClassLoader. We were hoping the tool would be able to analyse .class files without requiring them on the classpath. We al...

java extension mechanism

I've created a .jar containing some packages and I tried to put it into c:\jdk\jre\lib\ext but the java commnand does not find the package If I, instead, put the .jar into c:\jre\lib\ext all works! Why? The SUN's tutorial says that both the locations are good! I saw that the extension mechanism works only for VM but not for the ...

Weblogic application complains about some classes missing, how to debug?

I have a rather complex J2EE app I don't have any documentation for and I am trying to get it to run. I have gotten the ant build script to compile a EAR file that contains a WAR file, but this application even though I get "successfully deployed" on weblogic console is still not working. There are many required jars missing from the...

How do I put the entire lib directory (including all subdirectories) on the classpath using Ant?

I'm not sure this is the problem, but it looks like it might be the case. I'm getting build errors telling me that certain packages don't exist. These packages are packages that exist in .jar files within my lib directory. Any other packages within my java source files that I'm compiling and copying to the classes directory are working j...

The use of ":" and "." in a call to java with classpath declaration.

This is a scjp mock exam question. Suppose I have the following two files: package pkg; public class Kit { public String glueIt (String a, String b) {return a+b;} } import pkg.*; class UseKit { public static void main(String[]args) { String s = new Kit().glueIt(args[1],args[2]); System.out.println(s); } }...

scjp mock exam question about classpath

Given the default classpath: /foo And this directory structure: foo | test | xcom |--A.class |--B.java And these two files: package xcom; public class A { } package xcom; public class B extends A { } Which allows B.java to compile? (Choose all that apply.) A. Set the current directory to xcom then invoke jav...

Classpath resource within jar

Hi, I have a project A, which contains some java files and a classpath resource R.txt. Within the project I use ClassLoader.getSystemResource("R.txt"); to retrieve R.txt. Then I have a project B which includes project A's jar-file. Now getSystemResource("R.txt") wont find the textfile (and yes, it's still in the root of the jar file)...

Easiest way to manage my CLASSPATH?

I'm beginning to play with Clojure a bit and my Java experience is pretty limited. I'm coming from the dynamic world of Ruby and OO, so the functional side of things is very interesting! Anyway, as I discover libraries and various tools for use (and the tutorial files for the Pragmatic Clojure Book), everything typically calls for plac...

Can't use JFace and SWT in eclipse without creating plugin

DISCLAIMER: this is the classic case of .NET GUI trying to work his way around JAVA stuff. PROBLEM DESCRIPTION: I am trying to build a very simple GUI with JFace and SWT - the code is straightforward (there's plenty tutorials), what it's not so straightforward is that I can't seem to get JFace and SWT to work outside a plugin project...