classpath

Adding jars to classpath, Eclipse, Android

谁说我不能喝 提交于 2019-11-30 14:10:14
Currently, I go to properties-> build path-> libraries -> and then add external jars to my classpath, I know this is the correct way to do this, for java at least. However, the issue is I am running it on the Android SDK 2.1. When I run the program, I do not think the android emulator can "find" the .jars in the classpath. Is this possible? If so, which folder do I put the jars before adding them to my classpath? You can try doing it in eclipse by Right Click the jar --> Build Path --> Add to build path 1) Go to your Finder / Explorer and select your .jar files 2) Drag your .jar files into

Ant cannot find a class needed by an externally defined taskdef

余生长醉 提交于 2019-11-30 13:47:01
问题 I am trying to use the axis-java2wsdl ant task to create a wsdl from one of my java classes, but I cannot get the classpath correct. I am using Ubuntu's libaxis-java package which installs axis-ant.jar in $ANT_HOME/lib and axis.jar in /usr/share/java. The interesting parts of my build.xml look like this: <property name="library.dir" value="lib"/> <property name="system.library.dir" value="/usr/share/java"/> <path id="libraries"> <fileset dir="${library.dir}"> <include name="*.jar"/> </fileset

How to set eclipse to ignore the “Classpath Dependency Validator Message” Warning

谁说胖子不能爱 提交于 2019-11-30 13:17:22
问题 I would like it to have no warnings in my eclipse projects, but I get this one warning: Classpath entry org.eclipse.jdt.USER_LIBRARY/Liferay 6.1 GA Plugin API will not be exported or published. Runtime ClassNotFoundExceptions may result. from warning type Classpath Dependency Validator Message . I understand what eclipse is trying to say to me, but that is wrong, the library exists at the server and it is not right to export this with my projects. However, I need to set this warning in

How to put classes for javaagent in the classpath

。_饼干妹妹 提交于 2019-11-30 12:52:03
I am trying to develop a javaagent that would instrument code with help of asm-4. For now I'm stucked with a pretty basic problem, the classloader for the javaagent doesn't see asm dependencies and therefor fails. Do I have to provide a jar-with-dependencies (aka maven build plugin) which contains all the needed classes by the agent, or is there another way to add classes to the java agent? Referencing the jar asm-all.jar directly in the classpath didn't help. Building jar-with-dependencies didn't help at first, because Premain-Class attribute couldn't be set with assembly plugin. Help is

Scala REPL in Gradle

旧巷老猫 提交于 2019-11-30 12:42:12
At the moment Gradle's scala integration does not offer REPL functionality. How to ergonomically run a Scala REPL from Gradle with the appropriate classpath? Dominykas Mostauskis Minimal build.gradle : apply plugin: 'scala' repositories{ mavenCentral() } dependencies{ compile "org.scala-lang:scala-library:2.11.7" compile "org.scala-lang:scala-compiler:2.11.7" } task repl(type:JavaExec) { main = "scala.tools.nsc.MainGenericRunner" classpath = sourceSets.main.runtimeClasspath standardInput System.in args '-usejavacp' } Credit to this answer for explaining how to direct stdin with standardInput

Java classpath - Linux

荒凉一梦 提交于 2019-11-30 12:41:49
I am trying to understand how classpath really works. After searching around the web this is where I have reached so far: I have added export CLASSPATH="/home/foo:/home/foo/Java_code/my_code" at /etc/environment . I am running Ubuntu by the way. Java finds the path and compiles without problem. The problem is that if I change the CLASSPATH and then I do: source /etc/environment , the new CLASSPATH is not applied. It is applied if and only if I restart the system. For example if I delete the export CLASSPATH="/home/foo:/home/foo/Java_code/my_code" line, then I do source /etc/environment and I

How to reference an included file in OSGi bundle when performing java.io.File or FileInputStream

半腔热情 提交于 2019-11-30 12:15:55
I am using the aQute Bnd toolset to create an OSGi bundle and have packaged with some dependant 'resource' files. This includes *.css files and *.xsd files in a resources directory I have created. I have included the following in the bundle.bnd file: Include-Resource: resources/=resources/ and when I do a build, the generated *.jar file has the *.css and *.xsd files in the resources directory in the top directory of the jar bundle file. However, in the actual code I am having difficulty in trying to refer to this as part of my class path: I have tried the following: new File("resources/example

Adding jar to classpath when running from command line

我们两清 提交于 2019-11-30 12:12:27
Ok I know this question has been asked many many many times before, but I've googled it and looked at examples and looked at questions on SO for the past month, and I seriously cannot get this to work. I think the problem is that I want to be able to run the program from both Eclipse and the command line. I'm also using OSX and I think a lot of the examples I'm reading are for Windows/Linux. If I have a simple program compiled in Eclipse that I want to run from the command line I do this: java -cp bin MyProgram I have another program I compile and run in Eclipse, and this references the MySQL

In Maven, how output the classpath being used?

柔情痞子 提交于 2019-11-30 11:17:04
问题 For my current purposes I have a Maven project which creates a war file, and I want to see what actual classpath it is using when creating the war . Is there a way to do that in a single command -- without having to compile the entire project? One idea is to have Maven generate the target/classpath.properties file and then stop at that point. 回答1: To get the classpath all by itself in a file, you can: mvn dependency:build-classpath -Dmdep.outputFile=cp.txt Or add this to the POM.XML: <project

Ant + JUnit: NoClassDefFoundError

断了今生、忘了曾经 提交于 2019-11-30 10:53:34
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 advanced step of running this test case from within Ant (the final goal is to integrate with Hudson).