classpath

how do I execute a JAR and also add another JAR to the classpath? [duplicate]

半腔热情 提交于 2019-12-13 07:41:23
问题 This question already has answers here : executing java -jar via classpath vs in the jar file dir (2 answers) Closed 4 years ago . How do I execute HelloClient.jar with openejb-client on the classpath? thufir@doge:~$ thufir@doge:~$ java -cp -jar NetBeansProjects/HelloClient/dist/HelloClient.jar; apache-openejb-4.7.1/lib/openejb-client-4.7.1.jar org.acme.HelloClient Error: Could not find or load main class NetBeansProjects.HelloClient.dist.HelloClient.jar apache-openejb-4.7.1/lib/openejb

problem setting classpath of javamail?

徘徊边缘 提交于 2019-12-13 06:45:59
问题 I downloaded java mail because i wanted to run the code that had header files : import javax.mail.*; import javax.mail.internet.* But even after setting the class path i am unable to run that code. The jar files included in java mail are : mail.jar dsn.jar imap.jar mailapi.jar pop3.jar smtp.jar I edited my classpath variable and finally it was : C:\Program Files\Java\jdk1.7.0\lib;C:\Program Files\Java\javamail-1.4.4\mail.jar;C:\Program Files\Java\javamail-1.4.4\lib;.; The first jar file is in

How to prevent third-party JARs on the classpath from overriding my class dependencies?

自作多情 提交于 2019-12-13 06:13:43
问题 I am writing an application plugin in Java, and my plugin has dependencies on several third-party JARs. I am bundling these dependencies with my plugin so that I can deploy just a single JAR file. The host application may also be running plugins from other vendors. Unfortunately the host application puts all the plugins on the classpath, and I am not able to change this behavior. If another vendor's plugin is loaded before mine and uses an incompatible version of a dependency, my plugin could

how to run a java program stored in sub directory from another java program in the current folder [duplicate]

天涯浪子 提交于 2019-12-13 05:16:57
问题 This question already has answers here : when executing a program in subdirectory , exec command in java is not working well [duplicate] (2 answers) Closed 6 years ago . I have big problem, please help me My situation is this, i have program RegAlloc.java, that uses several classes that is another packages P1 and P2. RegAlloc.java and these 2 packages are in a folder called Temp1. Temp is folder that contains Temp1 and Simplify.java, this folder also contains Pacjages named P! and P2 i needs

Using {@link classname} for external API in my class

做~自己de王妃 提交于 2019-12-13 04:57:57
问题 I have the following: package test.tester; import org.apache.log4j.Logger; public class tester { private static Logger logger = Logger.getLogger(tester.class); /** * {@link org.apache.log4j.Logger} * * @param args */ public static void main(final String[] args) { logger.info("test"); } } This is generating the links to the Logger class successfully, but the javadoc tooling complains like so: Constructing Javadoc information... tester.java:3: package org.apache.log4j does not exist import org

Java classpath and package problems - referencing multiple jar files

£可爱£侵袭症+ 提交于 2019-12-13 04:50:00
问题 I have a java class I'm trying to run that references various other jar files. It looks something like this: package com.myapp.test; import java.io.File; import com.myapp.ref; import com.myapp.stuff; import com.strangersapp.stuff; import com.strangersapp.morestuff; public class myTest { public static void main... ... } The com.myapp.* classes are in another jar file called myapp.jar. The strangersapp classes are in a strangersapp.jar. There are several other referenced classes in various jars

Classpath issue when binding an instance in a Scala Interpreter

 ̄綄美尐妖づ 提交于 2019-12-13 02:33:17
问题 I already posted this question in scala lang forum but unfortunately I did not get any answer. Second chance ? I try to embed an interpreter an evaluate a scala snippet into this interpreter. I would like to bind an instance of a custom class within the interpreter. To sum up that would look like: import scala.tools.nsc._ import scala.tools.nsc.interpreter._ class C { def sayHello(s:String) = "hello "+s } object Main extends App { val c= new C val s = new Settings s.usejavacp.value=true val i

Unable to get file list from standard resource dir in Maven project with Spring PathMatchingResourcePatternResolver

心已入冬 提交于 2019-12-13 01:59:48
问题 NOTE: As per the accepted solution below, this appears to be realated only to the fact that Spring's DefaultResourceLoader does not use the classloader to create URL instances for resources, thus custom classloaders are ignored https://jira.spring.io/browse/SPR-8176 I have a standard Maven project, it looks something like this $ tree . ├── pom.xml └── src ├── main │ ├── java │ │ │ └── resources │ └── application.properties └── test └── java I will have more resource files shortly in a

Derby, Java: Trouble with “CREATE_TYPE” statement

十年热恋 提交于 2019-12-13 01:29:45
问题 I've been messing around with Apache Derby inside Eclipse. I've booted up a Network Server, and I've been working with servlets. In my Eclipse project, I have a class called "User", inside the package "base.pack". I have an SQL script open, and I've been trying to convert User, which implements Serializable, into a custom type. When I run the following lines, everything works fine: CREATE TYPE CARTEBLANCHE.bee EXTERNAL NAME 'base.pack.User' LANGUAGE JAVA This follows the general format they

Load files External To The Distribution Jar

一曲冷凌霜 提交于 2019-12-12 23:34:30
问题 I have written a Java program which I package and run from a JAR file. I need to have some user-changeable configuration files which are simply text lines of: key = value format. To load these files I used the class described here. When I run my program through Netbeans IDE all works fine as I have included the directory where I store the configuration files in the Project properties. The problem comes when I build my application into a JAR file. As I want the configuration files to be user