classpath

Convert web application project to maven project and convert corresponding .classpath file to pom.xml

对着背影说爱祢 提交于 2019-12-12 16:30:16
问题 Is it possible to convert project .classpath file to pom.xml after converting a simple web application project to maven project? Because if my project uses many jars and I want to convert it to maven then I will do configure->convert to maven but then it is not possible to add all the jars dependencies in pom.xml manually. So is there any tool to convert this. 回答1: First there is no tool to do such things. The problem is usually that you have a larger number of dependencies which you don't

Using custom Java classes in Clojure REPL

删除回忆录丶 提交于 2019-12-12 13:16:26
问题 In Eclipse, using the CCW plug-in, I want to load a clojure file into a REPL. The problem is that I have an import statement for one of my own java classes, but apparently it is not in my classpath. (ns my-clj-ns (:import [alg.gen Enumerator])) Do I have to make jars out of every class that I want use/test in a Clojure REPL? Currently, trying to load my clj into a REPL results in an error: "Load file in Clojure REPL" did not complete normally. Please see the log for more information. java

Adding a class to the class path with a Java Agent

我与影子孤独终老i 提交于 2019-12-12 12:27:55
问题 I'm using a Java Agent and Javassist to add some logging to some JDK classes. Essentially when the system loads some TLS classes, Javassist will add some additional bytecode to them to help me debug some connection problems. Here's the problem, given this class is included in the agent jar: package com.something.myagent; public class MyAgentPrinter { public static final void sayHello() { System.out.println("Hello!"); } } In my agent's transform method, let's say I tried to invoke that class

Accessing the value of eclipse classpath variable M2_REPO in run configuration VM arguments

て烟熏妆下的殇ゞ 提交于 2019-12-12 10:44:36
问题 In the run configuration of eclipse, you are provided with a set of default variables that you can use in the VM arguments, like container_path and env_var . What I want to access is a classpath variable, M2_REPO , but can't see a way of doing this. I need to specify a javaagent in the VM arguments, which requires a path to a jar file. This jar file lives in the maven repository, but I can't find a way of specifying the path to the maven repository using the already configured M2_REPO

Get Rhino JS to see Java class

孤街醉人 提交于 2019-12-12 09:44:55
问题 I'm playing with Rhino, and I've had success using Java classes from the stdlib, but not from Java code I compiled here. For example, this works fine: print(new java.util.Date()); But with NanoHTTPD (single .java file, no namespace, same folder), I'm having no luck at all: js> new Packages.NanoHTTPD() js: "<stdin>", line 4: uncaught JavaScript runtime exception: TypeError: [JavaPackage NanoHTTPD] is not a function, it is object. at <stdin>:4 I'm sure it's something simple. What am I missing?

Classpath set but java.lang.NoClassDefFoundError com/google/protobuf/MessageOrBuilder error?

旧时模样 提交于 2019-12-12 06:59:19
问题 I am trying to run a java program that uses protobuf.jar, but I keep getting this error. I have set my classpath variable in linux so that: CLASSPATH=/home/.../src/PlaceServer.class:/home/.../src/protobuf.jar:/home/.../src export CLASSPATH But then when I run my program in the command line after reading in the jar. java PServer I get this: java.lang.NoClassDefFoundError: com/google/protobuf/MessageOrBuilder However when I run another program that also reads the same jar, this one called

“error: cannot find symbol” using Apache POI

浪尽此生 提交于 2019-12-12 06:19:40
问题 This is my code: import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.*; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class Reader { public static void read_excel() { File excel = new File ("C:\\Users\\Username\\Desktop\\java-Tools\\data.xlsx"); FileInputStream fis = new FileInputStream

Caused by: java.lang.ClassNotFoundException: classpath

主宰稳场 提交于 2019-12-12 05:27:28
问题 I am trying to run Wikipedia Bayes Example from https://cwiki.apache.org/confluence/display/MAHOUT/Wikipedia+Bayes+Example When I ran the following command : $MAHOUT_HOME/bin/mahout wikipediaXMLSplitter -d $MAHOUT_HOME/examples/temp/enwiki-latest-pages-articles10.xml -o wikipedia/chunks -c 64 I am getting this error: Exception in thread "main" java.lang.NoClassDefFoundError: classpath Caused by: java.lang.ClassNotFoundException: classpath at java.net.URLClassLoader$1.run(URLClassLoader.java

How to set environment variables for javac to be able to find imported packages?

吃可爱长大的小学妹 提交于 2019-12-12 04:35:39
问题 I am not a java developer. I just want to run a java application (which can be downloaded from: http://code.google.com/p/k-shortest-paths/downloads/list , under this name: KShortestPaths_Java_v2.1.zip) While trying to compile test\edu\asu\emit\qyan\test\YenTopKShortestPathsAlgTest.java I get "package ... does not exist" and "symbol ... does not exist" which I know are related to path setting. Can you please tell me how I should set environment variables and from which directory compile and

classpath property file in grails app is not being used

﹥>﹥吖頭↗ 提交于 2019-12-12 04:23:03
问题 My problem is that I've put a well-formed properties file in my classpath and told grails to look for the properties file in my classpath, but the properties in the file aren't overriding the existing ones. In my config.groovy I have the lines: grails.config.locations = [ "classpath:${appName}-config.properties", "file:./${appName}-config.properties"] // verified that appName is being used. It prints out classpath:XXX-config.properties, as expected, where XXX is my appname. println "grails