classpath

Ant + JUnit: NoClassDefFoundError

强颜欢笑 提交于 2019-11-29 16:08:04
问题 Ok, I'm frustrated! I've hunted around for a good number of hours and am still stumped. Environment: WinXP, Eclipse Galileo 3.5 (straight install - no extra plugins). So, I have a simple JUnit test. It runs fine from it's internal Eclipse JUnit run configuration. This class has no dependencies on anything. To narrow this problem down as much as possible it simply contains: @Test public void testX() { assertEquals("1", new Integer(1).toString()); } No sweat so far. Now I want to take the super

How to remove error Picked up _JAVA_OPTIONS: -Xmx512M?

徘徊边缘 提交于 2019-11-29 15:32:28
In java program, When I try to compile some code it creates an error I get this message: Picked up _JAVA_OPTIONS: -Xmx512M what type of error is this the page Suppressing the "Picked up _JAVA_OPTIONS" message cannot solve problem ,how to change system variable in windows 7 ?? SUBHASIS MONDAL Go to my computer and right click on top of that and click on properties, a new window will open like below. then click on advanced system setting then click on environment variable and delete _JAVA_OPTIONS from user variable and then try again. Part of my original answer was truncated, so here is the

让Tomcat7识别War包的Class-Path(MANIFEST.MF)属性动态加载类路径

痴心易碎 提交于 2019-11-29 14:59:25
一、背景 几个Web项目需要打包到一个发布包中,问题是War包都各自包含了自己的WEB-INF/lib,其中不少依赖Jar有重复。所以希望把War包的所有的lib都放到外部的一个公共目录减小总工程大小。但放在一个目录,以目录方式加载到全局Classpath就会产生类库冲突问题,如:web1使用spring2,web2使用spring3。 二、分析 一般Jar包中都包含一个META-INF/MANIFEST.MF文件。在这个配置文件中可以指定一个Class-Path属性,再执行java -jar xxx.jar时,Java会以这个Class-Path属性中定义为准。 War包中也有MANIFEST.MF文件,当然也可以添加Class-Path属性(Maven)。但问题是这个属性从Java规范上讲并没有约定,所以应用服务器一般都不识别。 我们需要解决的是类路径加载的问题。还好Tomcat上下文配置文件的Context标签中有Loader标签,允许我们重写WebappLoader。 三、开发 1、Tomcat应用上下文XML配置样例 在Tomcat应用上下文配置文件中,定义Web工程的Loader指定到自定义WebappLoader。 <?xml version="1.0" encoding="UTF-8"?> <Context docBase="${xxx.home}/apps/xxx

#java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester

扶醉桌前 提交于 2019-11-29 13:42:03
I am getting java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester error and I am stuck with this error for more than a month. I have tried all Digester versions available and I also checked for duplicate JARs in classpath. I have designed the report through iReport-5.6.0 and I used the JARs from the iReport-5.6.0\ireport\modules\ext and other required JARs. Error-Log: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester at net.sf.jasperreports.engine.JasperCompileManager.compileReportToFile(JasperCompileManager.java:108) at net.sf

How to use variables for classpath definition in Eclipse launch configurations?

扶醉桌前 提交于 2019-11-29 12:47:15
问题 In our project we use Eclipse launch configurations which are under version control to be shared with all developers. Now it is necessary to include an external archive to a launch configuration file's classpath. Fortunately the required archive is in every developer's local Maven repository. I already found out that there is a classpath variable called M2_REPO which references to the local Maven repository (being valid for any developer). But how to use this variable in the following

request.getServletContext() not found, even with new JAR

自作多情 提交于 2019-11-29 12:27:23
问题 My compiler is not able to find the HttpServletRequest getServletContext() method. I am not doing anything too complicated: public static void setMySortedSet(HttpServletRequest request, SortedSet<String> set) { setMySortedSet(request.getServletContext(), set); } Some troubleshooting I have tried: Discovered the method was created in 2.3, so I included a JAR that reflects that (and have it in my Eclipse build path) I include the JAR in my build.xml classpath. When I using Eclipse the method is

RxTx installation on windows java.lang.NoClassDefFoundError: gnu/io/CommPort

家住魔仙堡 提交于 2019-11-29 12:00:43
I put rxtxcomm.jar into jre/lib/ext folder, but I still get NoClassDefFoundError Isn't this folder automatically taken into the global classpath? Thanks yes it is taken automatically to classpath, but RXTXcomm uses JNI /native external libraries (.so and .dll files), you must provide the path to them when running your program in command line: java -jar yourprogram.jar -Djava.library.path="PATH_TO_EXTERNAL_LIBRARIES" for linux: suppose you unpacked the rxtx.zip to /home/user/ if you have 32bit x86 platofrm: PATH_TO_EXTERNAL_LIBRARIES = /home/user/Linux/i686-unknown-linux-gnu/ if you have 64bit

clojure classpath problem for (require) function?

南笙酒味 提交于 2019-11-29 11:53:36
CLASSPATH has the "/Users/smcho/Desktop/clojure" as one of its path, and this directory has the file hello.clj. Running clojure, and running (require 'hello) give this error message. java.io.FileNotFoundException: Could not locate hello__init.class or hello.clj on classpath: (NO_SOURCE_FILE:0) When I change directory to "/Users/.../clojure", and run the same (require 'hello), there's no problem. The . is on the CLASSPATH. Running java -cp /Users/smcho/bin/jar/clojure.jar:/Users/smcho/Desktop/clojure clojure.lang.Repl also works. Why clojure can't find the source on the CLASSPATH? Like Alex

How to make javac find JAR files? (Eclipse can see them)

孤街醉人 提交于 2019-11-29 11:51:05
问题 When I'm in Eclipse my project compiles with no errors, however when I try to compile with javac it says I'm missing some packages... I copied my compile command and some of the error text below: javac -classpath lib/ -d bin/ src/*.java src/Cleaner.java:5: package net.sourceforge.jgeocoder does not exist src/MyUtilities.java:19: package org.apache.commons.codec.binary does not exist In Eclipse, I have added all the .JAR files to the build-path, and the program compiles just fine. Why can it

Adding database drivers to use WEKA classes

匆匆过客 提交于 2019-11-29 11:46:09
I tried to run the following command on the command-line: G:\Weka-3-6>java weka.core.converters.CSVLoader data.csv > data.arff This is the error message: ---Registering Weka Editors--- Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH? Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH? Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Error, not in CLASSPATH? Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH? Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in