Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Cygwin

  Asked By: Ronnie    Date: Jul 16    Category: Java    Views: 530
  

has anyone here successfully installed and run Java on a Cygwin system?

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Debbie Reyes     Answered On: Jul 16

I almost exclusivly use cygwin on my windows2000 machine so I don't have to deal
with Microsoft's dos command prompt. It works great. I haven't had any
problems with it.

 
Answer #2    Answered By: Leroy Schmidt     Answered On: Jul 16

what version of jdk are you using on 2k. And do you have to set up
anything special in either the /etc/profile or in the windows PATH
environment?

I apparently can compile, but when I go to execute a file I get a no
main class error even with a classpath specified to the java  class
file.

 
Answer #3    Answered By: Edwin Chavez     Answered On: Jul 16

sounds like you don't have a cygwin problem but a typical java  problem. I don't
know what your experience with java is but what you described sounds like a
typical classpath problem that most beginners have.

If you have HelloWorld.java NOT in a package you should compile it with a
command like:
$ javac HelloWorld.java
to run  it you would use the command:
$ java -classpath . HelloWorld
The "-classpath ." tells the java virtual machine to look in the current
directory for *.class files.

If you have HelloWorld.java PACKAGED in com.initech, you should compile it with
a command like:
$ javac -d . HelloWorld.java
the "-d ." will create the directories will put the HelloWorld.class file in
directories ./com/initech/HelloWorld.class. To run it you would use the
command:
$ java -classpath . com.initech.HelloWorld
The "-classpath ." tells the java virtual machien to look in the current
directory for *.class files. Because the file to execute is
"com.initech.HelloWord" the java virtual machine will look for the
HelloWorld.class file in a com/initech/ directory.

 
Answer #4    Answered By: Burk Martin     Answered On: Jul 16

Now that was strange.....

usually if I compile with something like

$ /cygdrive/c/j2sdk1.4.0/bin/javac -classpath /javapgms
Application.java

I should be able to run  it with

$ /cygdrive/c/j2sdk1.4.0/bin/java -classpath /javapgms Application

but that didn't work.....

But when I tried you idea of using the "this" '.' as a classpath it
works.... I must be having a strange week....this makes no sense since
. and /javapgms would be the same directory???

 
Didn't find what you were looking for? Find more on Cygwin Or get search suggestion and latest updates.

Related Topics:



Tagged:  

 

Related Post