Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #10400

Re: filenames on the command line

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!newsreader4.netcologne.de!news.netcologne.de!nx02.iad01.newshosting.com!newshosting.com!news-out.readnews.com!transit3.readnews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
From Lew <lewbloch@gmail.com>
Newsgroups comp.lang.java.programmer
Subject Re: filenames on the command line
Date Thu, 1 Dec 2011 06:54:48 -0800 (PST)
Organization http://groups.google.com
Lines 46
Message-ID <2304640.475.1322751289109.JavaMail.geo-discussion-forums@prfx15> (permalink)
References <7ea0b15a-e937-4fb8-9045-f5ffca1cf6de@u6g2000vbg.googlegroups.com>
Reply-To comp.lang.java.programmer@googlegroups.com
NNTP-Posting-Host 173.164.137.214
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
X-Trace posting.google.com 1322751619 4975 127.0.0.1 (1 Dec 2011 15:00:19 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Thu, 1 Dec 2011 15:00:19 +0000 (UTC)
In-Reply-To <7ea0b15a-e937-4fb8-9045-f5ffca1cf6de@u6g2000vbg.googlegroups.com>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T
User-Agent G2/1.0
X-Google-Web-Client true
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:10400

Show key headers only | View raw


giuseppe.on.usenet wrote:
> The current directory has two files:

That's your first mistake - using the current directory.

> /* A.java */
> package wrk.pkg;

This needs to be in directory "wrk/pkg/" relative to one of the classpath roots.

I.e., the current directory the way you're working.

> import wrk.B;
> class A { B b; }
> 
> /* B.java */
> package wrk;

This needs to be in relative directory "wrk/".

Notice that this is necessarily a *different* directory than the other class.

> public class B { }
> 
> The command javac -d . A.java B.java

You're supposed to use directory notation with javac rather than "dot" notation.

I was not aware that dot notation even worked here.

In any case, it only partially "worked", not completely, at best, because you have things in the wrong directories.

> compiles successfully, while javac -d . A.java
> halts because it "cannot find symbol: class B". My question is: by

Because things are in the wrong directories.

> adding other options, is it possible to have the compiler seek and
> compile B.java without specifying the filename on the command line?

Why don't you read the documentation?

You will find it astonishingly helpful.

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

filenames on the command line "giuseppe.on.usenet" <giuseppe.on.usenet@gmail.com> - 2011-12-01 06:37 -0800
  Re: filenames on the command line Lew <lewbloch@gmail.com> - 2011-12-01 06:54 -0800
    Re: filenames on the command line "giuseppe.on.usenet" <giuseppe.on.usenet@gmail.com> - 2011-12-01 07:46 -0800
      Re: filenames on the command line Lew <lewbloch@gmail.com> - 2011-12-01 09:01 -0800
    Re: filenames on the command line Roedy Green <see_website@mindprod.com.invalid> - 2011-12-02 01:56 -0800
  Re: filenames on the command line Roedy Green <see_website@mindprod.com.invalid> - 2011-12-02 01:35 -0800

csiph-web