Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #10311
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!cc2g2000vbb.googlegroups.com!not-for-mail |
|---|---|
| From | www <xsli2@yahoo.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Java classpath question and how to run a program from command line? |
| Date | Mon, 28 Nov 2011 13:50:14 -0800 (PST) |
| Organization | http://groups.google.com |
| Lines | 32 |
| Message-ID | <85f06dad-9e66-42ef-a232-d98c72832318@cc2g2000vbb.googlegroups.com> (permalink) |
| NNTP-Posting-Host | 205.156.36.56 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Trace | posting.google.com 1322517808 30940 127.0.0.1 (28 Nov 2011 22:03:28 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Mon, 28 Nov 2011 22:03:28 +0000 (UTC) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | cc2g2000vbb.googlegroups.com; posting-host=205.156.36.56; posting-account=oo44OQoAAABMDvaRlaO3SeQ5MVbxqLdH |
| User-Agent | G2/1.0 |
| X-Google-Web-Client | true |
| X-Google-Header-Order | HUALESNKRC |
| X-HTTP-UserAgent | Mozilla/5.0 (Windows NT 6.1; rv:8.0) Gecko/20100101 Firefox/8.0,gzip(gfe) |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10311 |
Show key headers only | View raw
Hi: Sorry. I am confused about how to run a Java class from command line(I can run it from Eclipse). I use Cygwin on Windows 7. This Java source file is /cygdrive/d/project/src/A/B/C/ MainWindow.java The class file(MainWindow.class) is located at /cygdrive/d/project/bin/ A/BC/MainWindow.class (compiled by Eclipse) MainWindow.java package is: package A.B.C; The following JAR files are also needed to run the program: /cygdrive/ d/project/libs/*.jar In Cygwin command window, "echo $CLASSPATH" does not show anything, so CLASSPATH has not been set. Now in Cygwin command window, I am at /cygdrive/d/project/bin, I typed the command below, but it didn't work: java -classpath /cygdrive/d/project/libs;. A.B.C.MainWindow Can you help me on how to run it from the command line? I also tried to set up CLASSPATH in .bashrc file beforehand: export CLASSPATH=/cygdrive/d/project/libs/;/cygdrive/d/project/bin I am confused: should I separate them by ";" or ":" ? I tried both ways, none of them is working: ". .bashrc" command complains or no complains, but MainWindow still cannot be run. Thank you very much.
Back to comp.lang.java.programmer | Previous | Next — Next in thread | Find similar | Unroll thread
Java classpath question and how to run a program from command line? www <xsli2@yahoo.com> - 2011-11-28 13:50 -0800
Re: Java classpath question and how to run a program from command line? Robert Klemme <shortcutter@googlemail.com> - 2011-11-28 23:08 +0100
Re: Java classpath question and how to run a program from command line? markspace <-@.> - 2011-11-28 14:21 -0800
Re: Java classpath question and how to run a program from command line? Lew <lewbloch@gmail.com> - 2011-11-28 15:58 -0800
Re: Java classpath question and how to run a program from command line? www <xsli2@yahoo.com> - 2011-11-29 06:14 -0800
Re: Java classpath question and how to run a program from command line? www <xsli2@yahoo.com> - 2011-11-29 06:54 -0800
Re: Java classpath question and how to run a program from command line? Lew <lewbloch@gmail.com> - 2011-11-29 07:43 -0800
Re: Java classpath question and how to run a program from command line? www <xsli2@yahoo.com> - 2011-11-29 09:22 -0800
Re: Java classpath question and how to run a program from command line? Lew <lewbloch@gmail.com> - 2011-11-29 12:08 -0800
Re: Java classpath question and how to run a program from command line? Roedy Green <see_website@mindprod.com.invalid> - 2011-11-29 13:57 -0800
csiph-web