public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Randall R Schulz <rrschulz@cris.com>
To: wally liau <wally_2nd@yahoo.com>, cygwin@cygwin.com
Subject: Re: HELP: java path and classpath question
Date: Mon, 11 Feb 2002 11:11:00 -0000	[thread overview]
Message-ID: <5.1.0.14.2.20020211105436.024f3b00@pop3.cris.com> (raw)
In-Reply-To: <20020211184547.34194.qmail@web13403.mail.yahoo.com>

Wally,

[ For those of us doing Java programming under Cygwin, this has become a 
FAQ and there are messages in the Cygwin mail archive that cover it. ]


Please give us more information about what happens. Specifically, what 
commands are you issuing. Tell us what program you're invoking (since your 
alias invokes the "java" command via the PATH, tell us what PATH is so we 
know which java command is being executed). Tell us what error message(s) 
result.


After I see through the confusing names that suggest that you're using the 
Gnu Java Compiler (which, as far as I know, is not yet available for 
Cygwin), it appears that at least part of your problem (quite possibly all 
of it) is that you're using POSIX-style class-path syntax when in fact 
you're invoking a Windows Java VM and hence must use a Windows-style 
class-path (semicolons separating the components and Windows-style full 
names, not Cygwin / POSIX -style). This applies both to the CLASSPATH 
environment variable and the various file name and class-path arguments to 
the JVM / JRE and Java compiler (all the Sun JDK and / or JRE executables, 
in fact).

If you're unaware of how to accommodate this, look into the "cygpath" 
command. It translates path names between POSIX and Windows formats. It can 
operate on an individual file name or PATH variable-like strings. There's 
no man page, use "cygpath --help".

For your own convenience, I suggest you write some wrapper scripts that 
obscure the need for Windows file name and path formats by transforming 
Cygwin-style arguments to their Windows equivalents for you. Otherwise your 
makefiles and other build scripts lose their portability to other POSIX 
environments. I use a generic script that I link (hard or symbolic) to a 
file with the same name as the target command. That way I achieve complete 
transparency and / or compatibility with native POSIX environments such as 
Solaris, Linux or *BSD and need only make a new link should a new tool be 
added to the Java SDK.

Randall Schulz
Mountain View, CA USA


At 10:45 2002-02-11, wally liau wrote:
>I am having a problem compiling generic java source file with following 
>settings:
>
>alias gjc='java -ms12m gjc.Main -bootclasspath
>$GJ_HOME/classes:/cygdrive/c/jdk1.3.1_01/jre/lib/rt.jar:/cygdrive/c/jdk1.3.1_01/jre/lib/i18n.jar'
>
>
>export JAVA_HOME=/cygdrive/c/jdk1.3.1_01
>export GJ_HOME=/cygdrive/c/Programs/gj
>
>The error messages show that cygwin can't find java class (eg, it can't 
>find String class). However, compiling stardard java code using "javac" 
>works fine. I guess there may be some problems with how to set up paths 
>and hope someone out there could help me to fix it. Thanks a lot.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

  parent reply	other threads:[~2002-02-11 19:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-11 10:45 wally liau
2002-02-11 11:06 ` Larry Hall (RFK Partners, Inc)
2002-02-11 11:11 ` Randall R Schulz [this message]
2002-02-11 14:39   ` wally liau
2002-02-11 16:09     ` Randall R Schulz
2002-02-17 13:11       ` rich-paul
2002-02-17 17:02         ` Randall R Schulz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.1.0.14.2.20020211105436.024f3b00@pop3.cris.com \
    --to=rrschulz@cris.com \
    --cc=cygwin@cygwin.com \
    --cc=wally_2nd@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).