classpath

Executing Maven unit tests with classpath set to generated project JAR

心不动则不痛 提交于 2019-12-05 02:09:30
问题 Some unit tests in my application are related to finding and manipulating certain files resources that are part of the application itself. I need these tests to be executed in the real production setting of the application, where it is deployed as a JAR file, not as an exploded directory. How could I instruct Maven to execute my unit tests considering as the classpath the project generated jar file (and any other declared library dependencies) instead of the compiled classes in the file

getResource() is returning null with Gradle project

吃可爱长大的小学妹 提交于 2019-12-05 01:30:45
I'm aware there are several other questions regarding this... Class.getResource() returns null Java - class.getResource returns null Calling context.getResources() returns null getClassLoader().getResource(filepath) returns a null pointer But my problems seems to be a bit different because I seem to have all of the necessary things to NOT have this problem. The code: this.getClass().getResource("checkstyle_whitespace.xml"); // null The issue is that I've verified my classpath by inspecting the class loader in the debugger. Here's what I am seeing: 27 = {URL@1235} "file:/Users/dennis/Documents

SBT Scaladoc Configuration

∥☆過路亽.° 提交于 2019-12-05 01:21:45
I'm trying to configure the Scaladoc in SBT, specifically the title, output directory and classpath. I managed to define the title by adding the following to build.sbt: scalacOptions in (Compile, doc) ++= Opts.doc.title("Scala-Tools") I can't figure out how to change the doc output directory. I also can't figure out how to add jars to classpath. The reason I want to edit the classpath is because it appears the standard Scala library is not getting picked up by scaladoc when I refer to its classes, i.e. [[scala.Option]] leads to a warning "Could not find any member to link for "scala.Option"."

Does not load JDBC Library on ARM by execute Java Applikation

非 Y 不嫁゛ 提交于 2019-12-05 00:58:12
Ok We have a Java-application "app.jar" in a unix home directory with a external Sqlite Driver Library. - myapp/app.jar - myapp/lib/sqlite-jdbc-3.8.7.jar Device Udoo ARM Cortex V9 simliar to Raspberry Pi. java -version java version "1.8.0_06 Java(TM) SE Runtime Environment (build 1.8.0_06-b23) Java HotSpot(TM) Client VM (build 25.6-b23, mixed mode) Try to run this application failed. java -classpath lib/sqlite-jdbc-3.8.7.jar -jar myapp.jar It seems that the Application cannot find the Library. java.lang.Exception: No native library is found for os.name=Linux and os.arch=arm at org.sqlite

How do I use environment variables in an Eclipse .classpath file?

限于喜欢 提交于 2019-12-05 00:51:17
In Windows I have an environment variable EXTERNAL_LIB_ROOT that points to C:\Program Files\MyExternalLibRoot. On another machine, it may point to C:\ExternalLibs. In an ant build.xml file I would use: <pathelement location="${env.EXTERNAL_LIB_ROOT}/path/to/jar.jar"/> How do I set up an Eclipse project .classpath file to use the EXTERNAL_LIB_ROOT environment variable? Is it possible to have Eclipse auto generate the build.xml file using the environment variable as above? Not an environment variable, but you can set up a Path Variable in Eclipse. Path variables are per-workspace. They are

How do I edit the (runtime) classpath in Eclipse?

假装没事ソ 提交于 2019-12-04 23:21:01
In Eclipse, while trying to start Tomcat, I am getting this error: The project: xxxxxxs which is referenced by the classpath, does not exist. The reason is, I renamed my project from xxxxxxs to xxxxxx (note no "s"). It is still referencing the old one. Where is the (runtime) classpath and how do I edit it? I know this is simple, and I've looked. ( Similar to Java Eclipse - How do I change the classpath? but I just want to know how to edit it, not how to solve my particular problem. ) Xonatron Found it now that I've asked: Run -> Run Configurations... -> Classpath This is for the runtime

Calling java with wildcards in classpath fails

喜欢而已 提交于 2019-12-04 20:20:03
问题 I have some jars in the current directory, all needing to be in the class path, so I want to use the wildcards convention for classpath. The command line is: java.exe -classpath * org.python.util.jython args However I get this error Exception in thread "main" java.lang.NoClassDefFoundError: G:/repo/builds/jars/edu_mines_jtk/jar Caused by: java.lang.ClassNotFoundException: G:.repo.builds.jars.edu_mines_jtk.jar at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController

Problems with Ant optional tasks SSHExec and SCP. Classpath issue?

醉酒当歌 提交于 2019-12-04 20:17:17
I'm in the process of modifying an Ant script (currently in use from within MyEclipse) to work from the command line. I'm doing this so anyone can check out the project and build it without MyEclipse. The problem I'm running into is that MyEclipse includes the dependencies behind the scenes. It does this by looking at the workspace's Ant configuration and compiling the classpath based on the selected libraries in the preferences dialog. Long story short, I need to take those dependencies and make the script smart enough to include them on its own, without the help of MyEclipse. The tasks that

Add user libraries to Ant Builder classpath

十年热恋 提交于 2019-12-04 19:34:51
问题 I am having a problem with setting up an Ant Builder for my Eclipse projects. I do have several 3rd party libs configured as user libraries within Eclipse. Those libraries are added to the build path of my projects and everything is working fine. My problem is, that if I want to use the Ant Builder from Eclipse, I will have to add some of the user libraries to the classpath of the Ant Builder to get it working. I need those Libs because they include several task defs and type defs for Ant,

Error: `error - java.lang.IllegalArgumentException: URI is not hierarchical while getting a file from a classpath

删除回忆录丶 提交于 2019-12-04 18:51:00
问题 I have a file contained within a directory in a classpath. It looks like this pl/shenlon/io/gui/appData/file.txt . Now, when I try to convert it to a File and read with this code: File cityNamesFile = new File(ClassLoader.getSystemResource("pl/shenlon/io/gui/appData/list.txt").toURI()); Scanner cns = new Scanner(cityNamesFile); I get the following:- error - java.lang.IllegalArgumentException: URI is not hierarchical. How can I fix this problem? 回答1: If your calling class is itself in the same