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


Groups > comp.lang.java.programmer > #32962 > unrolled thread

Package does not exist only for the packages I create, only on Windows 7

Started byLou <lourosas@gmail.com>
First post2015-10-31 08:27 -0700
Last post2015-12-17 08:22 -0800
Articles 5 — 2 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Package does not exist only for the packages I create, only on Windows 7 Lou <lourosas@gmail.com> - 2015-10-31 08:27 -0700
    Re: Package does not exist only for the packages I create, only on Windows 7 Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-10-31 11:46 -0400
      Re: Package does not exist only for the packages I create, only on Windows 7 Lou <lourosas@gmail.com> - 2015-12-15 13:35 -0800
        Re: Package does not exist only for the packages I create, only on Windows 7 Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-12-15 17:45 -0500
          Re: Package does not exist only for the packages I create, only on Windows 7 Lou <lourosas@gmail.com> - 2015-12-17 08:22 -0800

#32962 — Package does not exist only for the packages I create, only on Windows 7

FromLou <lourosas@gmail.com>
Date2015-10-31 08:27 -0700
SubjectPackage does not exist only for the packages I create, only on Windows 7
Message-ID<7b1f4811-ae84-4d4b-9ef1-0d5a076d62f3@googlegroups.com>
Hello,
So. for some odd reason, I am insisting on developing Java Code on a Windows 7 machine:  mainly because it can actually connect to a network drive easier...Using Tortoise SVN, I update all my developed code in the appropriate folders, and begin to compile...

I put most of my java code in packages in their appropriate directories:
i.e. rosas.lou.mypackage would be in a directory like 
/home/rosas/lou/mypackage... or
c:\rosas\lou\mypackage...

I include on my classpath...
When I go to use these packages in executables that I create, everything is fine when I compile:  on all my Linux machines, AND on the antiquated Windows Vista machine--the machines recognize the classpath and the packages...
But when I try to do this on a Windows7 machine, I get the error "Package xxx.xxxx.xxx does not exist...

Just for grins, on my Windows 7 machine, I removed the package declaration from the files, got rid of the import in the code using the package, and everything compiled and worked as it should...

This only happens on the packages I created...and only on my Windows 7 machine...

Anyone know what could be happening?

Thanks,

Lou Rosas

[toc] | [next] | [standalone]


#32963

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2015-10-31 11:46 -0400
Message-ID<n12nka$k1q$1@dont-email.me>
In reply to#32962
On 10/31/2015 11:27 AM, Lou wrote:
> Hello,
> So. for some odd reason, I am insisting on developing Java Code on a Windows 7 machine:  mainly because it can actually connect to a network drive easier...Using Tortoise SVN, I update all my developed code in the appropriate folders, and begin to compile...
>
> I put most of my java code in packages in their appropriate directories:
> i.e. rosas.lou.mypackage would be in a directory like
> /home/rosas/lou/mypackage... or
> c:\rosas\lou\mypackage...
>
> I include on my classpath...

     May we see your classpath?

> When I go to use these packages in executables that I create, everything is fine when I compile:  on all my Linux machines, AND on the antiquated Windows Vista machine--the machines recognize the classpath and the packages...
> But when I try to do this on a Windows7 machine, I get the error "Package xxx.xxxx.xxx does not exist...
>
> Just for grins, on my Windows 7 machine, I removed the package declaration from the files, got rid of the import in the code using the package, and everything compiled and worked as it should...
>
> This only happens on the packages I created...and only on my Windows 7 machine...
>
> Anyone know what could be happening?

     In addition to your classpath, could we see your
"java [options] classname" command line?  And the *exact*
text of any messages it produces?

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

[toc] | [prev] | [next] | [standalone]


#33352

FromLou <lourosas@gmail.com>
Date2015-12-15 13:35 -0800
Message-ID<1a336bc9-ebd6-483b-81ff-c391369bdb63@googlegroups.com>
In reply to#32963
On Saturday, October 31, 2015 at 8:46:46 AM UTC-7, Eric Sosman wrote:
> On 10/31/2015 11:27 AM, Lou wrote:
> > Hello,
> > So. for some odd reason, I am insisting on developing Java Code on a Windows 7 machine:  mainly because it can actually connect to a network drive easier...Using Tortoise SVN, I update all my developed code in the appropriate folders, and begin to compile...
> >
> > I put most of my java code in packages in their appropriate directories:
> > i.e. rosas.lou.mypackage would be in a directory like
> > /home/rosas/lou/mypackage... or
> > c:\rosas\lou\mypackage...
> >
> > I include on my classpath...
> 
>      May we see your classpath?
> 
> > When I go to use these packages in executables that I create, everything is fine when I compile:  on all my Linux machines, AND on the antiquated Windows Vista machine--the machines recognize the classpath and the packages...
> > But when I try to do this on a Windows7 machine, I get the error "Package xxx.xxxx.xxx does not exist...
> >
> > Just for grins, on my Windows 7 machine, I removed the package declaration from the files, got rid of the import in the code using the package, and everything compiled and worked as it should...
> >
> > This only happens on the packages I created...and only on my Windows 7 machine...
> >
> > Anyone know what could be happening?
> 
>      In addition to your classpath, could we see your
> "java [options] classname" command line?  And the *exact*
> text of any messages it produces?
> 
> -- 
> esosman@comcast-dot-net.invalid
> "Don't be afraid of work. Make work afraid of you." -- TLM

Sure...
Here are the path and classpath:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Lou>echo %PATH%
C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.6.0_31\bin;C:\Pro
gram Files\Java\jdk1.6.0_31\;.;C:\bin\;C:\Program Files\;C:\Program Files (x86)\
NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\W
indows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:
\Windows\system32;C:\Windows\SysWOW64\;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Services\IPT
\;C:\Program Files (x86)\Windows Live\Shared;c:\Program Files (x86)\Microsoft SQ
L Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c
:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\jEdit;C:\Pro
gram Files (x86)\MiKTeX 2.9\miktex\bin\;C:\Program Files (x86)\Bitvise SSH Client;C:\Program Files\TortoiseHg\;C:\Program Files (x86)\MySQL\MySQL Server 5.5\bin
;C:\Program Files\TortoiseSVN\bin

C:\Users\Lou>echo %CLASSPATH%
.;C:\Program Files\Java\jdk1.6.0_31\lib;C:\Program Files\Java\jre1.8.0_51\lib;C:\rosas\lou\test;C:\javaclasses\myclasses;C:\javaclasses\LClasses\rosas\lou;C:\javaclasses\LClasses\rosas\lou\clock;C:\javaclasses\LClasses\rosas\lou\weatherclasses;C:\Users\Lou\junit4.10\junit4.10\junit4.10.jar;C:\Users\Lou\junit4.10\junit4.10;C:\javaclasses\OneWireAPI.jar;C:\javaclasses\RXTXcomm.jar;

As an example:
c:\bin>javac PaceCalculatorMain.java
PaceCalculatorMain.java:24: package rosas.lou does not exist
import rosas.lou.*;
^
PaceCalculatorMain.java:25: package rosas.lou.calculator does not exist
import rosas.lou.calculator.*;
^
PaceCalculatorMain.java:29: cannot find symbol
symbol  : class PaceCalculatorController
location: class PaceCalculatorMain
      PaceCalculatorController pcc = new PaceCalculatorController();
      ^
PaceCalculatorMain.java:29: cannot find symbol
symbol  : class PaceCalculatorController
location: class PaceCalculatorMain
      PaceCalculatorController pcc = new PaceCalculatorController();
                                         ^
PaceCalculatorMain.java:30: cannot find symbol
symbol  : class PaceCalculatorView
location: class PaceCalculatorMain
      PaceCalculatorView pcv;
      ^
PaceCalculatorMain.java:31: cannot find symbol
symbol  : class PaceCalculatorView
location: class PaceCalculatorMain
      pcv = new PaceCalculatorView("Pace Calculator", pcc);
                ^
PaceCalculatorMain.java:32: cannot find symbol
symbol  : class PaceCalculator
location: class PaceCalculatorMain
      PaceCalculator pc = new PaceCalculator(pcv);
      ^
PaceCalculatorMain.java:32: cannot find symbol
symbol  : class PaceCalculator
location: class PaceCalculatorMain
      PaceCalculator pc = new PaceCalculator(pcv);

And I cannot understand why...any help would be great...thanks...

[toc] | [prev] | [next] | [standalone]


#33353

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2015-12-15 17:45 -0500
Message-ID<n4q50q$pqj$1@dont-email.me>
In reply to#33352
On 12/15/2015 4:35 PM, Lou wrote:
> [...]
> C:\Users\Lou>echo %CLASSPATH%
> .;C:\Program Files\Java\jdk1.6.0_31\lib;C:\Program Files\Java\jre1.8.0_51\lib;C:\rosas\lou\test;C:\javaclasses\myclasses;C:\javaclasses\LClasses\rosas\lou;C:\javaclasses\LClasses\rosas\lou\clock;C:\javaclasses\LClasses\rosas\lou\weatherclasses;C:\Users\Lou\junit4.10\junit4.10\junit4.10.jar;C:\Users\Lou\junit4.10\junit4.10;C:\javaclasses\OneWireAPI.jar;C:\javaclasses\RXTXcomm.jar;
>
> As an example:
> c:\bin>javac PaceCalculatorMain.java
> PaceCalculatorMain.java:24: package rosas.lou does not exist
> import rosas.lou.*;
> ^
>[...]

     No certain answers, but a few things look odd to me and may be
worth investigating:

     - Ordinarily, each directory on the CLASSPATH is a point from which
       Java begins its search for .class files.  When it searches, Java
       automatically tacks on the package names, so if it's looking for
       rosas.lou.Foo's .class file and the CLASSPATH tells it to begin at
       C:\foo\bar, it will look for C:\foo\bar\rosas\lou\Foo.class.  If
       CLASSPATH says C:\foo\bar\rosas\lou, Java appends rosas and lou
       and winds up with C:\foo\bar\rosas\lou\rosas\lou\Foo.class --
       which is probably not what you wanted.  In your CLASSPATH, the
       C:\rosas\lou\test entry looks suspicious, as do the various
       C:\javaclasses\LClasses\rosas\lou entries.

     - ... except that things are a bit different for JAR files, where
       CLASSPATH should point directly at the JAR that contains the
       desired .class elements.

     - Also, it appears your PaceCalculatorMain.java source file is in
       a directory named C:\bin, which is an odd-sounding place for a
       source file.  Make sure your source files are distributed among
       directories that match the organization of their packages: if
       the class is rosas.lou.PaceCalculatorMain, it should be in a
       file like \...whatever...\rosas\lou\PaceCalculatorMain.java.

     One other thing: Try adding "-verbose" as an option to your javac
command:

	javac -verbose PaceCalculatorMain.java

This will give you a whole ton of output, but you can wade through it
to discover where the compiler finds various classes.  It doesn't, alas,
tell you where the compiler looks when it *fails* to find a class, but
perhaps if you see where it succeeds you'll get an idea of what's amiss.

     Good luck!

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

[toc] | [prev] | [next] | [standalone]


#33363

FromLou <lourosas@gmail.com>
Date2015-12-17 08:22 -0800
Message-ID<4906006c-b939-4a86-ad89-7d5db65d0c9e@googlegroups.com>
In reply to#33353
On Tuesday, December 15, 2015 at 3:45:23 PM UTC-7, Eric Sosman wrote:
> On 12/15/2015 4:35 PM, Lou wrote:
> > [...]
> > C:\Users\Lou>echo %CLASSPATH%
> > .;C:\Program Files\Java\jdk1.6.0_31\lib;C:\Program Files\Java\jre1.8.0_51\lib;C:\rosas\lou\test;C:\javaclasses\myclasses;C:\javaclasses\LClasses\rosas\lou;C:\javaclasses\LClasses\rosas\lou\clock;C:\javaclasses\LClasses\rosas\lou\weatherclasses;C:\Users\Lou\junit4.10\junit4.10\junit4.10.jar;C:\Users\Lou\junit4.10\junit4.10;C:\javaclasses\OneWireAPI.jar;C:\javaclasses\RXTXcomm.jar;
> >
> > As an example:
> > c:\bin>javac PaceCalculatorMain.java
> > PaceCalculatorMain.java:24: package rosas.lou does not exist
> > import rosas.lou.*;
> > ^
> >[...]
> 
>      No certain answers, but a few things look odd to me and may be
> worth investigating:
> 
>      - Ordinarily, each directory on the CLASSPATH is a point from which
>        Java begins its search for .class files.  When it searches, Java
>        automatically tacks on the package names, so if it's looking for
>        rosas.lou.Foo's .class file and the CLASSPATH tells it to begin at
>        C:\foo\bar, it will look for C:\foo\bar\rosas\lou\Foo.class.  If
>        CLASSPATH says C:\foo\bar\rosas\lou, Java appends rosas and lou
>        and winds up with C:\foo\bar\rosas\lou\rosas\lou\Foo.class --
>        which is probably not what you wanted.  In your CLASSPATH, the
>        C:\rosas\lou\test entry looks suspicious, as do the various
>        C:\javaclasses\LClasses\rosas\lou entries.
> 
>      - ... except that things are a bit different for JAR files, where
>        CLASSPATH should point directly at the JAR that contains the
>        desired .class elements.
> 
>      - Also, it appears your PaceCalculatorMain.java source file is in
>        a directory named C:\bin, which is an odd-sounding place for a
>        source file.  Make sure your source files are distributed among
>        directories that match the organization of their packages: if
>        the class is rosas.lou.PaceCalculatorMain, it should be in a
>        file like \...whatever...\rosas\lou\PaceCalculatorMain.java.
> 
>      One other thing: Try adding "-verbose" as an option to your javac
> command:
> 
> 	javac -verbose PaceCalculatorMain.java
> 
> This will give you a whole ton of output, but you can wade through it
> to discover where the compiler finds various classes.  It doesn't, alas,
> tell you where the compiler looks when it *fails* to find a class, but
> perhaps if you see where it succeeds you'll get an idea of what's amiss.
> 
>      Good luck!
> 
> -- 
> esosman@comcast-dot-net.invalid
> "Don't be afraid of work. Make work afraid of you." -- TLM

Thanks!! That worked!!!  Some "confusion" with the whole thing from Windows to Linux, et. al...but I corrected the classpath as you instructed...thanks again...

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web