classpath

How to add multiple jar files in classpath in linux

懵懂的女人 提交于 2019-12-03 07:16:30
问题 Okay, I'm very new to linux and command line, and fairly new to java. I got an internship building a java program. I finally got it done on my machine (windows) and now I have to migrate it to a linux machine to test and then have it run as an executable. I have done much reading and researching on linux and understanding classpaths but it is still all very hard to fully comprehend. It's just not clicking for me yet. Can anyone explain the purpose of classpath in a simplified way using

Maven not setting classpath for dependencies properly

橙三吉。 提交于 2019-12-03 07:03:20
问题 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

How do I add an icon as a classpath resource to an SWT window created with WindowBuilder?

只谈情不闲聊 提交于 2019-12-03 06:19:51
I'm trying to add an external icon from an *.ico file to a window that I'm creating using the WindowBuilder design window. I can select the shell, which brings up an "image" properties field. That brings up the image chooser dialog box: How do I make my icon show up in this menu as a classpath resource? The image works if an absolute path is given, but I don't want to use that option in my application. Thanks! To easily add an icon to my classpath, I found my desired icon, right clicked it, selected "copy", then went to one of the packages of my project in Eclipse, right clicked, and selected

Understanding the Eclipse classpath declarations

此生再无相见时 提交于 2019-12-03 06:17:30
I'm trying to understand the Eclipse classpath file, in particular, I want to know this: How is the JRE using it (i.e. is the JVM reading this xml file directly, or is eclipse somehow feeding it into its internal compiler)? How are the complex entries (like the ivy path below) parsed and incorporated into the JVM ClassLoader when I run my classes from my IDE? Context: I have a strange bug which is that eclipse is using the "wrong" version of a class, whereas my ivy / ant build is using the correct version, and I thus want to tool Eclipse to better mimick the classloader used in my pure build.

How do you configure a Spring bean container to load a Java property file?

眉间皱痕 提交于 2019-12-03 06:16:58
问题 How do you configure a Spring bean container (or application context) to load a Java property file? JavaWorld article Smartly Load Your Properties explains how to load property files from the classpath using one of the following resource processing methods in the standard Java library: ClassLoader.getResourceAsStream ("some/pkg/resource.properties"); Class.getResourceAsStream ("/some/pkg/resource.properties"); ResourceBundle.getBundle ("some.pkg.resource"); How can you do the same using a

Maven cannot resolve dependency for module in same multi-module project

蹲街弑〆低调 提交于 2019-12-03 06:13:26
问题 When running commands such as mvn dependency:build-classpath or mvn exec:java Maven is unable to resolve a dependency of one of my modules on another. [ERROR] Failed to execute goal on project parser-app: Could not resolve dependencies for project project_group:A:jar:0.1-SNAPSHOT: Could not find artifact project_group:B:jar:0.1-SNAPSHOT The project structure is as follows: /pom.xml /A/pom.xml /B/pom.xml The parent pom is as follows: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi

Javac vs Java within -classpath option

送分小仙女□ 提交于 2019-12-03 06:03:13
What is the difference in calling the -classpath option from javac and from java for example: javac -classpath MyJar.jar GetJar.java java -classpath MyJar.jar:. GetJar it works as well as: javac -classpath MyJar.jar GetJar.java java GetJar So basically where the first -classpath related to javac needs to be there, on the other hand in the java command line it might be optional. Why? Do you know in which circumstance it would be mandatory. And more in general what is the effect of -classpath called by javac and what is the effect of -classpath called by java . Thanks in advance. One is the

How to add configuration file to classpath of all Spark executors in Spark 1.2.0?

旧时模样 提交于 2019-12-03 05:59:58
I'm using Typesafe Config, https://github.com/typesafehub/config , to parameterize a Spark job running in yarn-cluster mode with a configuration file. The default behavior of Typesafe Config is to search the classpath for resources with names matching a regex and to load them into your configuration class automatically with ConfigFactory.load() (for our purposes, assume the file it looks for is called application.conf ). I am able to load the configuration file into the driver using --driver-class-path <directory containing configuration file> , but using --conf spark.executor.extraClassPath=

CLASSPATH vs java.ext.dirs

99封情书 提交于 2019-12-03 05:57:59
is there any reason why to favor using (possibly very long) CLASSPATH variable to set which jars should be on classpath durign application run then to use the java 1.5+ property -Djava.ext.dirs which specifies whole directory(directories) of jars to be searched? To make it real-life example I have standalone java application with lib folder containig all dependent jars. Sofar the start script is setting all the (maybe 20) jars to CLASSPATH variable one by one. Since now my application archive is generated by Maven I can't see in advance what the jar names would be (e.g. I change version of a

What's the minimum classpath for an Axis2 client?

不羁的心 提交于 2019-12-03 05:33:53
问题 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? 回答1: ( 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