classpath

java classpath in unix

混江龙づ霸主 提交于 2019-12-04 18:11:43
I can run java in cygwin+windows using the following settings (the sw/jar directory has several jar files, and I pick the relevant one from the java command line): CLASSPATH=.;C:\sw\java_6u35\lib\\*;C:\sw\jar\\* java org.antlr.Tool Calc.g But I am having the following problems when running in linux: (1) I can't set a directory name in a classpath, the following line reports an error: setenv CLASSPATH .:/sw/jdk1.6.0_35/lib/\*:/sw/jar/* (2) when I run explictly with -jar option, I still get an error: java -jar /sw/jar/antlr-3.4.jar org.antlr.Tool Calc.g error(7): cannot find or open file: org

How to install jar library?

╄→гoц情女王★ 提交于 2019-12-04 17:57:54
问题 I've downloaded the ANTLR Java runtime libraries. It's a jar file. It contains "org.antlr.runtime". Where do I put it so that the Java compiler can find it? Do I need to extract it? I'm using NetBeans (for now), if relevant. 回答1: For NetBeans you go to your Projects Tab and then right-click on the project you want the library added to then click Properties. Go to the Libraries bullet then on the right side click on Add JAR/Folder. No need to extract it. All you have to do is right click in

Folder with jars in project

*爱你&永不变心* 提交于 2019-12-04 17:53:58
问题 When I work on small desktop projects I used to create lib folder in my project's root where I keep all project's jar dependencies. Then I use Configure Build Path -> Libraries -> Add JARs... to manually add all jars from this folder to buildpath/classpath. And because Add JARs... (unlike Add external JARs ) uses relative paths, the project is portable, what is important for me. The problem is that each time I add or remove a jar from my lib folder I need to manually add/remove this jar in

How can I make Ant use JAXB 2.2.x instead of Java 6 SE JAXB classes in javac?

好久不见. 提交于 2019-12-04 17:21:58
I'm in the process of updating a legacy application to use Java 6 SE instead of Java 5 SE. The app uses JAXB, and under Java 5 SE it have the JAXB reference implementation jars on the classpath. When I moved to Java 6 SE (update 38), I hit a few bumps (see linked Stackoverflow question ) that I resolved with some help. So the next thing that is causing trouble is the project Ant build script. When the Ant compile task executes, it picks up the embedded version of JAXB that comes with Java 6 SE rather than the version from the jars that I have included on the classpath (the JAXB 2.2.6 release).

Access project classes from a maven plugin

微笑、不失礼 提交于 2019-12-04 17:13:53
I'm making a maven plugin that run in test phase, in pom.xml configuration of a project that uses my plugin, I'm setting a class canonical name that I want to use to run that class from my plugin, basically I'm making a way to have a dynamic class loading of classes inside the project from my plugin. Class clazz = Class.forName("... class from pom.xml ...") When I run it I receive the expectable "ClassNotFoundException", seems the class loader are not the same or not shared. There is a way to do it? Like capture the class loader from the project or receive it by dependency injection into my

Parent Last Classloader to solve Java Class path hell?

好久不见. 提交于 2019-12-04 16:54:56
I have a project which uses two versions of bouncyCastle jars bcprov-jdk15 and bcprov-jdk16. The jvm loads the older version but there is a feature I wrote which needs the newer version to run. I tried to solve this classpath hell by using a custom class loader. After some googling and with the help of some previous Stackoverflow answers [1] [2] and this blog , I wrote the following Parent Last Class loader to load the classes from the newer jar before delegating to the parent class loader. public class ParentLastClassLoader extends ClassLoader { private String jarFile; //Path to the jar file

JBOSS ordering of contents of WEB-INF/lib

早过忘川 提交于 2019-12-04 16:12:52
I have an ear file, containing a war file. The war contains a number of jars in its WEB-INF/lib directory. Some of these jars contain confilicting (or at least different ) versions of the same classes. Is there a way that I can influence the order that JBOSS will add these jar files on to the classpath? For example, if com.dave.A.class is found in a.jar and b.jar, both of which are in WEB-INF/lib, and I know that b.jar contains the "correct" version of the class, how do I ensure that JBOSS uses b.jar in preference to a.jar. I'm aware that this makes my application extremely fragile, so please

How to parse and interpret ant's build.xml

拈花ヽ惹草 提交于 2019-12-04 14:02:45
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 manifest match when the product goes out to production. EDIT: Regarding the responses (and thank you for them) to use an XML API, the problem is that the build file as currently constructed is more complex than that. Namely the classpath references a different

How to use a class from JAR in eclipse

强颜欢笑 提交于 2019-12-04 12:49:15
问题 I have two jar files - jar1 and jar2. Both of them are located in C:\Eclipse projects\ and I have added the paths to both of them to the Environment Variable CLASSPATH as follows .;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\Eclipse projects\stdlib.jar;C:\Eclipse projects\algs4.jar the ".;" at the beginning were there so I left them. Then I added the jars to the project from their location C:\Eclipse projects\ and they showed up as Referenced Libraries. However, when I try to instantiate

Add all jars from a folder to jmeter classpath

混江龙づ霸主 提交于 2019-12-04 12:24:21
I have a CI server dumping several application jars and their various dependencies in a single folder. I'm trying to then run a jmeter test with all the jars in jmeter's classpath. I can set jmeter's user.classpath property to a (semi-)colon separated list of individual jars, but using a wild card doesn't seem to be supported. Is there a way I can add the entire folder worth of jars to jmeter's classpath? As per How to Use JUnit With JMeter guide: You can also “tell” JMeter to look into additional locations via the “user.classpath” property. This property lives in the “user.properties” file