classpath

How to set a long Java classpath in Windows?

╄→гoц情女王★ 提交于 2019-12-27 17:20:26
问题 I'm trying to run a particular JUnit test by hand on a Windows XP command line, which has an unusually high number of elements in the class path. I've tried several variations, such as: set CLASS_PATH=C:\path\a\b\c;C:\path\e\f\g;.... set CLASS_PATH=%CLASS_PATH%;C:\path2\a\b\c;C:\path2\e\f\g;.... ... C:\apps\jdk1.6.0_07\bin\java.exe -client oracle.jdevimpl.junit.runner.TestRunner com.myco.myClass.MyTest testMethod (Other variations are setting the classpath all on one line, setting the

NoClassDefFoundError while trying to run my jar with java.exe -jar…what's wrong?

风流意气都作罢 提交于 2019-12-27 12:12:52
问题 I have an application that I'm trying to wrap into a jar for easier deployment. The application compiles and runs fine (in a Windows cmd window) when run as a set of classes reachable from the CLASSPATH. But when I jar up my classes and try to run it with java 1.6 in the same cmd window, I start getting exceptions: C:\dev\myapp\src\common\datagen>C:/apps/jdk1.6.0_07/bin/java.exe -classpath C:\myapp\libs\commons -logging-1.1.jar -server -jar DataGen.jar Exception in thread "main" java.lang

Add JAR to WAR's classpath without changing the WAR file

痞子三分冷 提交于 2019-12-25 18:41:24
问题 I deploy a WAR file in Tomcat. In addition I have a JAR file. Is it possible to make the classes in the JAR file available to services in the WAR file without changing the WAR file, or does it have be added to the WAR's WEB-INF/lib? I've tried adding the JAR to lib/ , but it doesn't work. Spring fails with org.springframework.beans.factory.BeanCreationException » java.lang.NoClassDefFoundError upon startup. EDIT I realized that I might have made myself an unsolvable and architectually ugly

ClassPathXmlApplicationContext from a Runtime.getRuntime.exec

时光总嘲笑我的痴心妄想 提交于 2019-12-25 09:01:04
问题 I developp a web app in eclipse with spring to handle dependency injection & maven to deploy. I'm trying to make work this little code : public class MainExternal { public static void main( String[] args ) throws Exception{ @SuppressWarnings("resource") ApplicationContext appContext = new ClassPathXmlApplicationContext( "classpath*:webConfiguration/applicationContext.xml"); ProjectBo projectBo = (ProjectBo) appContext.getBean("projectBo"); System.out.println("-> Im 'in "); /*************

Java database path not found

喜欢而已 提交于 2019-12-25 08:18:51
问题 I'm attempting to change the file path of eclipse java neon to access a database I need for my programming class and I cant figure out how to do it for windows 10 (the book only instructs us on on how to do it in window 8 and 7). I'll give you the short version and just say that the book tells me to either edit the current classpath to look something like .; C:\Program Files\Java\jdk1.7.0_51\db\lib\derby.jar or to make a new one that looks like that. The problem is when I changed it to look

What classpath does maven set for different goals? Can you provide a link to official docs?

孤人 提交于 2019-12-25 07:39:17
问题 To what does Maven set the classpath for different goals? My issue: I have a project that I am building in Jenkins. It gets checked out form SVN. As the next thing, a different file is checked out into workspace-root/mydir/my.properties Then, maven test is run. In the test, a class loads the file by searching it on the classpath. Why does that work? (I'm new to Jenkins and maven and am trying to figure out how the job I'm looking at works...) 回答1: Maven uses the <dependencies/> defined in

Where to define the classpath for server side jars ? manifest.mf versus CLI argument -cp

给你一囗甜甜゛ 提交于 2019-12-25 07:30:10
问题 Realized a similar question was posted earlier but had no answers. Uuse both a manifest.mf and also pass jars using cp? What is the best way to define classpath in java batch environment? Can both Manifest.MF and cp argument via Command line be used or Do one override the other or Do one takes precedence over the other? If I am using JavaEE-API jar instead of the actual JMS* and XML* jars which are available on the server. Do I need to include each individual jar in the build.gradle as

Simbad requires Java 3D

柔情痞子 提交于 2019-12-25 07:27:38
问题 Context: MS Windows 8, jre7 preinstalled by MS Windows setup, MS Windows PATH environment variable has set to JRE7 bin folder - C:\Program Files (x86)\Java\jre7\bin, simbad-1.4.jar is downloaded into a local folder. Use cases: simbad-1.4.jar is run by command line java -jar simbad-1.4.jar or by just double-clicking on simbad-1.4.jar In both cases Simbad requires Java 3D error message box appears. Yes, I know, setting-up Java 3D should probably fix the issue but I'd like to just deliver/setup

Load ResourceBundle from classpath

此生再无相见时 提交于 2019-12-25 05:34:18
问题 I have two jar files. One of the jars needs to read language pack from another jar. Here is basic structure of both jars jar1 |--com.example.BundleLoader jar2 |--strings |--language.properties |--language_fr.properties Language pack is on the classpath. In order to read language packs by the BundleLoader I am trying to use ResourseBundle in conjunction with ClassLoader. This is how I am attempting to do that <--snipet--> private ResourceBundle englishStrings = null; private ResourceBundle

Getting last file access time using BasicFileAttributes in Java SDK 1.8

牧云@^-^@ 提交于 2019-12-25 05:15:19
问题 I have seen most of the previous questions here on Java 1.7 and getting the last file access time. Here's also a good snippet on import library and how they get the last file access time: http://kodejava.org/how-do-i-get-file-basic-attributes/ I did this: BasicFileAttributes attrs = Files.readAttributes(file, BasicFileAttributes.class); FileTime time = attrs.lastAccessTime(); However, in my IntelliJ IDEA IDE it says, BasicFileAttributes could not be resolved. So, I imported this: import java