classpath

Android Exception: 'java.lang.NoClassDefFoundError: javax.jmdns.JmDNS'

纵饮孤独 提交于 2019-12-29 08:58:12
问题 Hopefully my issue isn't too silly but I'm having the following problem... I'm importing a jar which contains the library JmDNS into my project. My project sets up to handle JmDNS like this... setUp(); try { peer = new PublicPeer("Aidan",6666,6667,this); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } private void setUp(){ android.net.wifi.WifiManager wifi = (android.net.wifi.WifiManager) getSystemService(android.content.Context.WIFI_SERVICE); lock = wifi

clojure classpath problem for (require) function?

北慕城南 提交于 2019-12-29 08:03:28
问题 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

set the classpath in order to connect between mysql to jdbc

旧时模样 提交于 2019-12-29 07:55:14
问题 I use the programs: eclipse and mysql. I have a database in mysql and I want to connect between the eclipse to the mysql. I have some folders in my project that I created in the eclipse. I have the main folder: testest.. and I show you what I have in the relevant folders: testest ..src ....testest ......testestservlet.java ..app engine sdk ..JRE system library ..referenced library ..war ..lib ....mysql-connector-java-5.1.22 I updated my testestservlet.java: package testest; import java.io

Java class is present in classpath but startup fails with Error: Could not find or load main class

与世无争的帅哥 提交于 2019-12-29 07:21:11
问题 I have a jar file foobar.jar containing the following two classes: public class Foo { public static void main(String[] args) { System.out.println("Foo"); } } The other class looks like this: import javax.batch.api.chunk.ItemProcessor; public class Bar implements ItemProcessor { public static void main(String[] args) { System.out.println("Bar"); } @Override public Object processItem(Object item) throws Exception { return item; } } If I execute the program using the following command, the

Howto print java class garbage collection events?

允我心安 提交于 2019-12-29 06:49:25
问题 java version "1.5.0_14" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03) Java HotSpot(TM) Server VM (build 1.5.0_14-b03, mixed mode) I'm trying to debug a NullPointerException I'm getting for passing a reference to statically defined field. To be more specific, I'm setting a global on a Drools3 working memory instance. workingMemory.setGlobal("log", workingMemorieslog); My assumption is that the Class where the field is statically defined is being garbage collected. (The

Maven does not add classpath to Eclipse project

╄→гoц情女王★ 提交于 2019-12-29 04:29:12
问题 I have a maven project, that I'm working on Eclipse. I use maven eclipse:eclipse to generate the classpath, but ... it NEVER adds the classpath on the eclipse project. I've tried the maven-eclipse-plugin, I've tried the M2Eclipse plugin, but it doesn't matter what I do, I can't get the classpath entries to start working. I have many build errors, even thought the maven builds the ear perfectly. Any guidelines? Thanks for any answer! UPDATE: Here's my root classpath: <?xml version="1.0"

How do I include jars in a groovy script? [duplicate]

ε祈祈猫儿з 提交于 2019-12-28 07:39:27
问题 This question already has answers here : How do I auto load a database jar in Groovy without using the -cp switch? (4 answers) Closed 3 years ago . I have a groovy script that needs a library in a jar. How do I add that to the classpath? I want the script to be executable so I'm using #!/usr/bin/env groovy at the top of my script. 回答1: If you really have to you can also load a JAR at runtime with: this.getClass().classLoader.rootLoader.addURL(new File("file.jar").toURL()) 回答2: Starting a

Java: NullPointerException from class.getResource( … )

£可爱£侵袭症+ 提交于 2019-12-28 06:46:53
问题 I was writing a small application and when I tried to create an ImageIcon I always got an exception. The exception was caused by this line of code: prayerLevel.setIcon(new ImageIcon(getClass().getResource("/icons/icon_prayer.png"))); Now within my program, the folder /icons/ does exist. I don't know if it makes the difference but the class file is within a package, where as the icons folder is within the project folder (when you would see the bin and src folder). I have looked around for a

Purpose of buildscript block in Gradle

纵饮孤独 提交于 2019-12-28 04:39:07
问题 I am new to Gradle and I am reading the documentation but I don't understand some parts of it. One of these parts is connected with buildscript block. What is its purpose? If your build script needs to use external libraries, you can add them to the script's classpath in the build script itself. You do this using the buildscript() method, passing in a closure which declares the build script classpath. buildscript { repositories { mavenCentral() } dependencies { classpath group: 'commons-codec

Adding jdbc driver to classpath

家住魔仙堡 提交于 2019-12-28 01:34:49
问题 Ok I am on Win Vista and correctly set my MAVEN_HOME, JAVA_HOME stuff. but I do not have a class path yet. I have also installed MySQL. now I have opened a Hibernate book and at the very first pages it says "make sure the jdbc driver is in your classpath" . I have also downloaded some Zip file that is ConnectorJ or some name like that which is basically the mySql driver for java... but my problem for now is this sentence that I have no clue how to do it: "make sure the jdbc driver is in your