File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Java and Cygwin Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Java and Cygwin" Watch "Java and Cygwin" New topic
Author

Java and Cygwin

Tim Eapen
Greenhorn

Joined: May 28, 2006
Posts: 22
Hello everybody:

I just downloaded cygwin and have been fooling around with it to compile and run simple java programs. I get a lot of class java.lang.NoClassDefFound errors. Here is what I type at the command line:

java -classpath 'cygpath -wp /cygdrive/c/test' jarname.Hello

So I try and use cygpath to convert UNIX style path to Windows style path (i.e. the classpath should be C:\test). The above works when I open up a DOS prompt: java -classpath C:\test jarname.Hello

What am I doing wrong?

Tim
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29257
    
140

Originally posted by Tim Eapen:
java -classpath 'cygpath -wp /cygdrive/c/test' jarname.Hello

Tim,
You are running this in the Cygwin window making it a UNIX command. (I realize this statement is obvious to you, I'm just adding it for anyone reading this.)

In a UNIX command, single quotes mean to leave the String as is. Backward quotes/backticks (`cmd`) execute a command.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Tim Eapen
Greenhorn

Joined: May 28, 2006
Posts: 22
That's awesome Jeanne.

Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java and Cygwin
 
Similar Threads
NoClassDefException in 1.4
How to use wild card in CLASSPATH in cygwin bash to compile and run
Java, cygwin and the jargs.gnu.CmdLineParser option
Remote Debugging using Jbuilder X and Jboss 3.2.x
Running java with a classpath on cygwin