Results 1 to 3 of 3
- 05-25-2012, 08:00 PM #1
Senior Member
- Join Date
- Apr 2012
- Posts
- 127
- Rep Power
- 0
help with Eclipse class files in Package - running at command line
I have made a java project that is one large package in Eclipse. I copied the contents of the "bin" folder and the "lib" folder to a new working directory. the "bin" folder as i'm sure you know is the compiled class files from ecplipse. the "lib" folder contains several jar files that are used in my java package (as imports).
When I attempt to run this program from the command line, i get the dreaded:
i'm not entirely sure why its not running, as i've made sure the package "com.amazonservices.mws.orders.samples" is in the same working directory as all the jar files it needs to run. Can someone help point me in the right direction? My goal is to schedule this program to run every so often using windows task scheduler or similar.Java Code:C:\Documents and Settings\jason.s\Desktop\AMZ_Downloader\demo>java -classpath . com.amazonservices.mws.orders.samples.ListOrderItemsSample Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/ht tpclient/HttpConnectionManager at com.amazonservices.mws.orders.samples.ListOrderItemsSample.main(ListO rderItemsSample.java:79) Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.HttpC onnectionManager at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more
Thanks!
edit: in case it helps, here's what my working directory looks like:
Java Code:C:\Documents and Settings\jason.s\Desktop\AMZ_Downloader\demo>dir Volume in drive C has no label. Volume Serial Number is 60D3-6F94 Directory of C:\Documents and Settings\jason.s\Desktop\AMZ_Downloader\demo 05/25/2012 10:51 AM <DIR> . 05/25/2012 10:51 AM <DIR> .. 04/17/2012 02:20 PM 54,829 activation.jar 05/25/2012 10:39 AM <DIR> com 04/17/2012 02:20 PM 46,725 commons-codec-1.3.jar 04/17/2012 02:20 PM 279,781 commons-httpclient-3.0.1.jar 04/17/2012 02:20 PM 52,915 commons-logging-1.1.jar 04/17/2012 02:20 PM 78,850 jaxb-api.jar 04/17/2012 02:20 PM 826,289 jaxb-impl.jar 04/17/2012 02:20 PM 3,108,955 jaxb-xjc.jar 04/17/2012 02:21 PM 46,047 jsr173_1.0_api.jar 05/25/2012 10:18 AM 376 KickStarter.class 05/25/2012 10:51 AM <DIR> lib 04/17/2012 02:21 PM 367,444 log4j-1.2.14.jar 04/24/2012 11:44 AM 749 log4j.properties
- 05-28-2012, 11:42 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: help with Eclipse class files in Package - running at command line
That classpath will only pick up classes in the current directory.
It won't pick up the jar files.
In order to do that you'll need an extra
./*.jar
in there as well as the
.
So
-cp .;./*.jar
(Check whether it is a semi colon or a colon for the separator).Please do not ask for code as refusal often offends.
- 05-29-2012, 04:33 PM #3
Senior Member
- Join Date
- Apr 2012
- Posts
- 127
- Rep Power
- 0
Similar Threads
-
Linux running/compiling from Command Line?
By arcelivez in forum New To JavaReplies: 4Last Post: 01-27-2012, 11:10 PM -
Running Main from Command Line
By sriram56 in forum New To JavaReplies: 2Last Post: 11-26-2011, 09:27 AM -
Open a URL and read it line by line (Works in Eclipse but not from Command Line)
By rosco544 in forum NetworkingReplies: 16Last Post: 09-17-2011, 02:41 AM -
Error While Running Windows Command Line Instruction
By divs1210 in forum AWT / SwingReplies: 5Last Post: 04-13-2011, 04:09 PM -
Compiling/Running Project in Command Line: "Could not find main class" Error
By Yasemin Gokce in forum New To JavaReplies: 1Last Post: 06-30-2009, 02:32 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks