classpath

Remove project .jars from project explorer view in Eclipse

梦想与她 提交于 2019-12-03 05:22:04
问题 The list of jars just takes up too much space. Can I collapse it or hide it? 回答1: In the Project Explorer : Customize View Check Libraries from external Or in the Package Explorer : Uncheck the 'Show Referenced Libraries Node' Add a filter to hide "*.jar" files 回答2: Another solution would be using the Package Explorer view. 回答3: In Eclipse3.5, select the filter "libraries from external" in "customize view". 回答4: In Eclipse 3.7 open view menu (arrow down icon in right section of title) of

Error when start Solr cloud, due to location of 3rd party libraries

柔情痞子 提交于 2019-12-03 03:48:35
I tried to migrate to Solr 3.1 , my project uses Dataimport handler , when I started solr it asked me SolrCoreAwar not found I copied the following file to lib directory apache-solr-dataimporthandler-3.1-SNAPSHOT.jar but again an error appeared when stating solr I need to fix this problem , if you can help Thank You The next message is the exception I get When Starting Solr 3.1 java.lang.NoClassDefFoundError: Could not initialize class org.slf4j.LoggerFactory at org.apache.solr.handler.dataimport.DataImportHandler.<clinit>(DataImportHandler.java:72) at java.lang.Class.forName0(Native Method)

Finding all CLASSPATH resources matching a pattern

拥有回忆 提交于 2019-12-03 02:30:48
I want to read a bunch of text files, by loading them as resources using the context classloader. URL url = Thread.currentThread() .getContextClassLoader() .getResource("folder/foo.txt"); Is there some way to get a list of resources whose names match a given pattern? For eg: URL[] matchingUrls = someLibrary.getMatchingResources("folder/*.txt"); Libraries like Spring can scan the classpath to find classes with a given annotation, so I am wondering if there something similar to load a bunch of resources. Spring supports ant-style class path resource matching. http://static.springsource.org

How to programmatically call a Maven-task

家住魔仙堡 提交于 2019-12-03 01:49:41
I'm using Maven in the context of another build-tool (leiningen for Clojure, but this should not matter), and I would like to know how I would call a plugin like dependency:build-classpath programmatically (i.e. via the Maven-API, not via the mvn -command). See how org.apache.maven.plugin.testing.AbstractMojoTestCase from maven-plugin-testing-harness is implemented. Here's a code snippet from some of my tests which may be helpful. public abstract class JAXBGenerateTest extends AbstractMojoTestCase { static { System.setProperty("basedir", getBaseDir().getAbsolutePath()); } protected

Including JAR files in Eclipse (App Engine) project

风格不统一 提交于 2019-12-03 01:44:18
I have been searching for a solution for this issue for multiple hours today and many hours yesterday so I decided to address it here, although it seems a stupid issue. Situation: I have a Google AppEngine project setup in Eclipse Java EE. It's there for multiple weeks everything runs fine, I can deploy to App Engine and test in Eclipse without probs. Now I need to add JAR packages for f.e. JSON support and Google Visualization API. I tried JSON a week ago and because it failed, I just downloaded the source files and added them to my own source. But now with the Visualizations thing, it are

Missing .classpath file in Eclipse project

大城市里の小女人 提交于 2019-12-02 23:06:13
I have recently returned to a project after not using it for a couple of weeks. The project was not created in Eclipse it was imported, and there is no '.classpath' file in the project workspace. I am sure that previously I successfully added new .jar files by simply right clicking them and going to 'Add to build path', but thanks to an unrelated error I had to re-add the files to the build path, and now whenever I try to add a new .jar file I get the following error: Error while adding a library Reason: Could not write file C:\Users\Charles\workspace\hive\.classpath Or, if I try to add a file

How To add an External jar File to the ClassPath Dynamically at runtime?

被刻印的时光 ゝ 提交于 2019-12-02 22:32:55
I want to add a jar File to my project's classpath dynamically using java code if it is possible , I want to use external jar files and load their classes the execute them as Beans later (Spring framework). Thanks :) Nikolay Kuznetsov URLClassLoader child = new URLClassLoader (myJar.toURL(), this.getClass().getClassLoader()); Class classToLoad = Class.forName ("com.MyClass", true, child); Method method = classToLoad.getDeclaredMethod ("myMethod"); Object instance = classToLoad.newInstance (); Object result = method.invoke (instance); Source: https://stackoverflow.com/a/60775/1360074 You can

Maven not setting classpath for dependencies properly

女生的网名这么多〃 提交于 2019-12-02 20:38:46
OS name: "linux" version: "2.6.32-27-generic" arch: "i386" Family: "unix" Apache Maven 2.2.1 (r801777; 2009-08-06 12:16:01-0700) Java version: 1.6.0_20 I am trying to use the mysql dependency in with maven in ubuntu. If I move the "mysql-connector-java-5.1.14.jar" file that maven downloaded into my $JAVA_HOME/jre/lib/ext/ folder, everything is fine when I run the jar. I think I should be able to just specify the dependency in the pom.xml file and maven should take care of setting the classpath for the dependency jars automatically. Is this incorrect? My pom.xml file looks like this: <project

Is the Java classpath final after JVM startup?

好久不见. 提交于 2019-12-02 20:29:07
I have read a lot about the Java class loading process lately. Often I came across texts that claimed that it is not possible to add classes to the classpath during runtime and load them without class loader hackery (URLClassLoaders etc.) As far as I know classes are loaded dynamically. That means their bytecode representation is only loaded and transformed to a java.lang.Class object when needed. So shouldn't it be possible to add a JAR or *.class file to the classpath after the JVM started and load those classes, provided they haven't been loaded yet? (To be clear: In this case the classpath

What's the minimum classpath for an Axis2 client?

◇◆丶佛笑我妖孽 提交于 2019-12-02 20:05:19
I want to build an Axis2 client (I'm only accessing a remote web service, I'm not implementing one!) with Maven2 and I don't want to add 21MB of JARs to my project. What do I have to put in my pom.xml to compile the code when I've converted the WSDL with ADB? ( Note: This response was provided by Aaron Digulla himself. What follows is the exact text of his own answer.) In maven2, the minimum dependency set to make an ADB client work ("ADB" as in the way you created the Java classes from the WSDL) is this: <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-kernel</artifactId>