Package confusions

Dear Gurus,
I am having issues with using packages in an exercise I thought would be fairly simple.
This is the output from the command line compilation:
C:\javatest>javac -verbose -classpath .;C:\packages PersonDriver.java
[parsing started PersonDriver.java]
[parsing completed 40ms]
[loading C:\j2sdk1.4.2_02\jre\lib\rt.jar(java/lang/Object.class)]
[loading C:\j2sdk1.4.2_02\jre\lib\rt.jar(java/lang/String.class)]
[checking PersonDriver]
[loading C:\packages\person\Person.class]
PersonDriver.java:7: cannot access person.Person
bad class file: C:\packages\person\Person.class
class file contains wrong class: packages.person.Person
Please remove or make sure it appears in the correct subdirectory of the classpa
th.
Person bob = new Person("Bob", "Hope");
^
[total 310ms]
1 error
It appears that it loads the Person.class i.e. [loading C:\packages\person\Person.class] but that when I try to instantiate a person object access is denied - PersonDriver.java:7: cannot access person.Person
Either I have made an absolute mistake in my interpretation of what a package's use truly is (highly likely)
or have set up the classes wrong. This part of the error is especially mysterious to me:
class file contains wrong class: packages.person.Person
The packages directory is set up as in: C:\packages\person\[Classes]
The code follows:
<_______________________________________________________________>
This a class in another folder (C:\javatest) in which I am wanting to use the
person class from a package in (C:\packages\person).
import person.*;
public class PersonDriver
public static void main(String[] args)
Person bob = new Person("Bob", "Hope"); // java states it cannot access person.Person
<______________________________________________________________>
This is a seperate file from PersonDriver.java. The person class residing
in the package 'person' (C:\packages\person)
package packages.person;
import java.util.*;
An implementation of a person
public class Person
public Person(String f, String l)
firstName = f;
lastName = l;
public String toString()
String result = new String();
result = this.lastName + ", " + this.firstName + "\n";
return result;
// private variables
private String firstName;
private String lastName;
}// end class Person

YATArchivist ,
Thanks and perhaps you could help clarify my understanding a bit.
After making the following change to Person.java:
package person; // instead of package packages.person
and in PersonDriver:
import person.*; // instead of import packages.person.*;
The program compiled:
C:\javatest>javac -verbose -classpath .;c:\packages; PersonDriver.java
[parsing started PersonDriver.java]
[parsing completed 50ms]
[loading C:\j2sdk1.4.2_02\jre\lib\rt.jar(java/lang/Object.class)]
[loading C:\j2sdk1.4.2_02\jre\lib\rt.jar(java/lang/String.class)]
[checking PersonDriver]
[loading c:\packages\person\Person.class]
[wrote PersonDriver.class]
[total 371ms]
However it throws a 'java.lang.NoClassDefFoundError' which the Java site states:
... The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found.
If I supplied the same CLASSPATH at compilation that I do when executing then why isn't the definition found.
I sincerely appreciate your help.

Similar Messages

  • Pan Newsreader AUR Packages Confusion...

    Hi,
    not sure of this is the right group for this, but i just built a new Arch box and was installing my standard newsreader, Pan (v.0135) from files in the AUR, a process I've completed successfully a couple of times on other machines.  Odd thing was, the version I installed kept segfaulting when I tried to delete article headers, a basic app function.   I tried recompiling, checked the dependencies individually, etc., but nothing worked. 
    Then, I carefully scanned the AUR package list again and noticed that the package I had compiled, "pan-git," was not the only AUR package listed for Pan.  I uninstalled pan-git then built and installed the correct pan-gtk3, which also gave me a functioning Pan v. 0.135, but this one doesn't constantly segfault--yay! 
    Maybe I missed something in the documentation that explains why package pan-git exists, but for now, it's confusing to anyone wanting to build a functioning instance of Pan on their system.
    The package that actually compiled to a properly functioning application is this one, pan-gtk3:
    https://aur.archlinux.org/packages.php?ID=50009
    thanks

    -git packages may be providing a more up to date software as it uses git instead of formal releases as the source.
    I can't access AUR atm, I'll have a look later. Fixed itself.
    Edit: You can just check the PKGBUILDS and see the differences
    https://aur.archlinux.org/packages.php?ID=43523
    https://aur.archlinux.org/packages.php?ID=31228 includes "Temporary bugfix version by K. Haley. With nzb gui patch by Heinrich Mueller." - as mentioned in the description
    https://aur.archlinux.org/packages.php?ID=43523 - uses gtk2
    Last edited by karol (2011-10-11 17:32:51)

  • HD package confusion - sports channels and Extreme HD

    I'm a recent FIOS convert from Optimum. After about 10 days I can say I am very pleased for the most part with the new service. Picture quality is better and I like the guide and DVR features better than my Optimum STB.
    The one problem I have had surfaced on the day of my installation. I ordered the Extreme HD package along with the movie promo package for 3 months. When I went to test my new gear with the Golf Channel HD it showed "not subscribed" and my installer explained that I wouldn't be getting that (or Tennis, which I also wanted) if I wasn't also subscribed to a Sport Package.
    I pulled out the channel line-up document I was given when I placed the order at  Verizon kiosk. It's the "Downstate New York August 2009" color brochure. In it there is a big red box for "Extreme HD" that says (quoting now) "EXTREME HD includes all channels in the box below & in FIOS TV Local. Additional subscriptions may be added. To order this package or other subscription packages go to verizon.com/fiostvcentral." All of the sport channels, including Golf, Tennis, NFL, etc. are listed in the box and there is nothing to suggest that additional subscriptions are needed. That's what the salesman confirmed.
    So, my poor installer guy said he couldn't do anything. I called Verizon, got shuffled around a bit, and finally got to someone who tried explaining that the brochure in my hand wasn't actually the one for the area I live in. And yet my community is one of those listed under Local Programming.
    In the end what he offered to do was to give me the additional sport package subscription for a discount for the next 12 months. At that point I was tired of spending time on the phone. But I am still not happy about it.
    Has anybody had a similar experience? It's the only black mark on my FIOS so far, but it's a pretty big one.

    Believe me, I have been over this thing with a magnifying glass looking for something like that. It just isn't there. Of course, there is the standard language at the end of the brochure that "Programming services offered within each package are subject to change..."
    Still, it feels a bit like bait and switch. I was getting Golf and Tennis (both SD and HD) in Optimum for no additional charges.

  • Multiple Subscription Package Confusion

    I have a 400 min subscription to Australia, but find I'm using about 2 x that per month, however when I look at adding another (of the same) it appears the second dosn't kick in until the first one's billing period has expired, which dosn't really make sense as won't the first one be renewed and active again then? 
    I see if I add a different (# of minutes) subscription it'd kick in immediatly after the first ran out of minutes, (what I need) but they're only available in 120min packages.
    Is that the best option? It's more expensive than another 400min sub, but I just can't see how to get two x 400min subs working "back to back".

    Hi Caniwi,
    Upon reading FAQ's it shows that we can have identical subscriptions with the same number of minutes however it will be active once the currect one expires. If you want the minutes to be activated right away, you should choose a different number of minutes.
    Support page says:
    For example, if you buy a Brazil 120 minutes subscription on the 1st of the month, and use all your minutes by the 20th, then buy a Brazil 60 minutes subscription, you can start using the Brazil 60 minutes subscription right away. You don't have to wait until the billing period for the first subscription has come to an end.
    For more information, please see Support Page: Can I Have Multiple Subscriptions
    I hope this information is helpful.

  • Package confusion

    hello friends,
    could you explain to me , if we write a class without including any package name and save in some file thn
    is it kept in a default package by the java runtime system (if yes suppose i store this file in c:\programs\somefile.java thn what is it's default package name)
    if not thn what is the concept of unnamed package??

    if not thn what is the concept of unnamed package??What do you mean by concept? You should normally avoid placing classes in the default package. It's usually only really small applications or tests which are placed in the default package (because you don't expect to re-use the code)
    Kaj

  • NVIDIA package confusion

    I'm trying to understand the Arch Nvidia packages but the wiki isn't overly clear.
    Currently, I use the nvidia-173xx package with a Geforce 7800 GTX card, since, at installation, I believed that the older cards weren't supported by the Nvidia package in Extra. 
    However, I recently discovered that version 285.05.09 supports my card, according to the supported products tab on:
    http://www.nvidia.co.uk/object/linux-di … er-uk.html
    So, firstly, should I ditch nvidia-173xx and revert to the main Nvidia package?
    And secondly, since nvidia-173xx requires linux<3.1 due to incompatibility with xorg 1.11, presumably linux should be added to the IgnorePkg list in pacman.conf, along with the currently ignored packages below?:
    xf86-input-evdev
    xf86-input-keyboard
    xf86-input-mouse
    xf86-video-nv
    xf86-video-vesa
    xorg-server
    xorg-server-common
    Once Nvidia produce a driver suitable for xorg 1.11, I'll be able to un-ignore these, and install Nvidia instead of 173xx (or even 173xx-all).  Correct?

    Cotton wrote:What is nvidia-173xx for then?
    For older cards, like my fx 5500.

  • System Imaging Utility 2 - Add Packages Confusion

    I have a NetInstall workflow in Leopard. Define Image Source (disk), Add Packages, Create Image (NetInstall type). It works.
    I have a NetRestore workflow in Snow Leopard. Define Image Source (dvd), Add Packages, Create Image (NetRestore type). It works.
    But when I try to do the same thing in Snow Leopard using disk instead of dvd as the source my packages are not installed. Snow Leopard Installer restores the disk image OK but ignores my packages.
    Does anyone know - Is this behavior a bug or a feature?
    Cheers

    I was having issues with 10.6.2 not even imaging that has since been resolved with 10.6.3. My issue now is, that it is not finding my System.dmg that it creates inside of NetInstall.dmg to restore. It works fine as long as I don't create a workflow but workflows do not. Even the simplest of definine source automated install create image it won't do. You would think Apple would have tested this stuff on 10.6 machines. All seems fine if I image on a 10.5 machine.

  • Cannot run using pam authenticated user?

    Using RHEL 4 on an institutional network in which users are centrally managed. Acroread 8.1.1 will not start with ordinary user as
    acroread
    (acroread:24638): GLib-WARNING **: getpwuid_r(): failed due to unknown user id (.....)
    Basically, this is not going to work.

    Hi, thanks for replies
    I am indeed able to launch 'firefox', both as local user and as remotely authenticated user. Likewise, 'gedit' is no problem
    The authentication method is called LDAP .
    Here's the nsswitch.conf ( it seems like the ldap is already included here )
    passwd: files ldap
    shadow: files ldap
    group: files ldap
    hosts: files dns
    bootparams: files
    ethers: files
    netmasks: files
    networks: files
    protocols: files ldap
    rpc: files
    services: files ldap
    netgroup: files ldap
    publickey: files
    automount: files ldap
    aliases: files
    The Red-Hat EL4 provided Acroread 7.0.8 5/22/2006 also only works as local user, otherwise it produces a not-terminating stream of syntax error messages. (Package confusingly numbered acroread-7.0.9-1.2.0.EL4)
    Using new AdobeReader_enu-8.1.1-1.i486.rpm, as local user, the program runs. but gives some message about missing library. I wish the program place the error message in the stderr or similar, or at very least allowed cut and paste from the error dialog box, as it would be so much easier to tell you exactly what the error message says. It's the 32-bit/64-bit thing.
    I have read the mailing list about this issue and see that it may be easily fixed, however unless the reomote authentication issue can be fixed, there is not much point.

  • [SOLVED] Confused about development packages

    To build an embedded linux image using minifs utility, I need to install some development packages. The packages listed in the tutorial are named for Debian based distros, with the "-dev" suffix. Some of the listed packages are: libz-dev, libelf-dev, libelfg0-dev, libncurses-dev, etc.
    I can't find these packages, and I'm a bit confused. I have read that these packages in Arch Linux have different suffixes denpending on the origin (-cvs, -git, etc.), but I can't find any packages with that suffixes. For example for ncurses:
    $ pacman -Ss ncurses
    core/ncurses 5.9-3 [instalado]
    System V Release 4.0 curses emulation library
    extra/cmus 2.4.3-1
    A very feature-rich ncurses-based music player
    extra/finch 2.10.1-1
    A ncurses-based messaging client
    extra/moc 20110528-5
    An ncurses console audio player with support for the mp3, ogg, and wave
    formats
    extra/naim 0.11.8.3.2-2
    An ncurses AOL Instant Messenger and IRC client.
    extra/ncmpc 0.20-1
    A ncurses (command line) interface for MPD
    community/echat 0.04beta1-3
    vypress compatible ncurses chat (can work without server)
    community/ekg2 0.3.1-2
    ncurses based Jabber, Gadu-Gadu, Tlen and IRC client
    community/ncdu 1.8-1
    Disk usage analyzer with an ncurses interface
    community/rtorrent 0.8.9-2
    Ncurses BitTorrent client based on libTorrent
    community/ruby-ncurses 1.3.1-3
    Module for interactive text console applications (ncurses)
    community/sniffit 0.3.7.beta-11
    very good packet sniffer for unix with ncurses interactive mode.
    community/vifm 0.7.2-1
    Ncurses based file manager with vi like keybindings
    community/yacpi 3.0.1-3
    ncurses-based acpi monitor.
    No ncurses-cvs, ncurses-git, ncurses-svn or the like is found. How can I find development packages?
    Last edited by doragasu (2012-03-09 22:38:03)

    doragasu wrote:So in Arch, packages include not only binaries + resources, they also include header files? If I install for example ncurses, also header files for ncurses get installed?
    headers, pkg-config, everything in one package, that is required for a compilation. we keep stuff simple
    Last edited by wonder (2012-03-09 22:37:46)

  • I uploaded the upgrade to Photoshop Elements 12 today.  I got a "dispatching error" for Photoshop Elements, but was able to download Premier elements!  I did not order Premier Elements, so I'm confused (unless this was a package that I did not know about)

    I uploaded the upgrade to Photoshop Elements 12 today.  I got a "dispatching error" for Photoshop Elements, but was able to download Premier elements!  I did not order Premier Elements, so I'm confused (unless this was a package that I did not know about).  I really want the Photoshop Elements upgrade - not Premier Elements.  I do hope I did not pay for both - I only want one.  Help!

    Maryrhire910 I am sorry that you are facing difficulty downloading and installing Photoshop Elements 12.  Are you downloading the installation files from Download Photoshop Elements products | 13, 12, 11, 10?  If so what specific error are you receiving?

  • Confusion with JDBC Optional Package for CDC.

    I am somewhat confused as to where this optional package fits.
    1. Is the implementation of this optional package to be COMPLETELY supplied by the database vendor(e.g. hsqdb, Oracle)?
    OR
    2. Is there an implementation available from Sun?
    OR
    3. Has Sun simply not released an implementation yet?
    OR
    4. Am I completely missing something here and losing my mind :)
    OR
    Is the JVM supposed to supply the implementation?
    Thanks for any enlightenment.
    J

    The actual specification can be written without actually talking to a database (the spec is mostly interfaces). However, you are write in that along with these classes (which must pass the TCK) the database vendor must provide the rest. Unlike normal java.sql where there is a DriverManager class, that is not the case in JSR-169.

  • Confusion in Package.

    Hi,
    I know what is function, procedure and Package.
    Syntax as well but identically.
    i know what is IN, OUT, IN OUT parameters. but when matter comes to a package which have 1 function and 2 procedure (1 procedure which is performing and action same as function and second is the main procedure). at this place i am confused that how this functiona and procedures talk with each other.
    It will be help full if someone use scott schema tables and incorporate cursors as well for function and procedures.
    I searched google but un-fortunatly have't got and sutabe example wich clarifies my doubt.
    Can any one help me out to understand Package.
    Thanks
    Bachan.

    hi,
    just try this code
    you have to run this part of code first -- package specification
    create or replace package p_scott_test as
    function f_get_sum_sal (p_deptno in number) return number;
    procedure p_get_sum_sal(p_deptno in number);
    end;
    then run this code -- package body
    create or replace package body p_scott_test as
    function f_get_sum_sal(p_deptno in number) return number is
    v_sum_sal number:=0;
    begin
    select sum(nvl(sal,0)) into v_sum_sal from scott.emp where deptno=p_deptno
    return v_sum_sal;
    end;
    procedure p_get_sum_sal(p_deptno in number)is
    cursor c1 is select deptno from scott.dept order by 1 ;
    v_tot_sal number:=0;
    begin
    for rec in c1 loop
    v_tot_sal:=f_get_sum_sal(rec.deptno);
    dbms_output.put_line('Departent : '||rec.deptno||' - TOTAL SALARY : '||v_tot_sal);
    end loop
    end;
    end;

  • Confused with package statement

    My classpath is set to as follows:
    .;C:\projects\profjava;
    I create a class Xyz.classis in package com.sunil.misc that means the full location of this class is
    C:\projects\profjava\com\sunil\misc\Xyz.class
    when I execute following:
    C:\ > java Xyz
    I get following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: FontPropertiesPanel
    when I execute it from within C:\projects\profjava\com\sunil\misc
    I get following error:
    Exception in thread "main" java.lang.NoClassDefFoundError: FontPropertiesPanel (
    wrong name: com/sunil/misc/FontPropertiesPanel)
    at java.lang.ClassLoader.defineClass0(Native Method)
    at java.lang.ClassLoader.defineClass(Unknown Source)
    at java.security.SecureClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.defineClass(Unknown Source)
    at java.net.URLClassLoader.access$100(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    Whats going on here? In first case I can understand it is not able to find the class hence the error. But in second case it is finding the class and I'd expect it to appent the package structure ie com\sunil\misc to be appended with classpath and form a full path like
    c:\projects\profjava\com\sunil\misc\Xyz.class ... am I right. Can any one explain this ?
    When you run a class with java command how does it finds the class ? In order to find in which package class resided it needs to find the class itself first, because, I think package information is with in the class. Its a loop isn't it ? I am confused... any input will be great !!!
    Thanks,
    Sunil

    You can't use "Xyz" for "com.sunil.misc.Xyz" with the java command. There is no "import"-statement to be used with the runtime environment. :)
    Java also cannot start searching for a class called Xyz from the classpath. Imagine your classpath contains "the current directory". You try to do something like:
    C:\>java ClassThatDoesNotExist
    Would you really expect the java runtime environment to go through every file and each directory on your C: drive searching for something that's not there, plus all the other paths that you have in the classpath? I don't think you would...
    When you run a class with java command how does it
    finds the class ?You'll find this interesting: http://java.sun.com/j2se/1.3/docs/tooldocs/tools.html
    Check the doc "How Classes are Found".

  • I'm confused with the struts.action and those in the actions package-help

    hi all
    looking at the struts framework particularly the org.apache.struts.actions package, i am a bit of confused as to which abstract action class i need to extend in my application. is there any guideline that shows in what scenario i will need to extend which action? how would i ever know the purpose of each one and how and when to extend it?
    and also i am even more confused when i saw org.apache.struts.action.action class. doesn't this one handle all? most tutorials i have seen reference this class. why do we have others in the actions package?
    your help is much appreicated . thanks.

    Simple actions just extend org.apache.struts.action.Action.
    Those actions in the org.apache.struts.actions package are utility Actions that provide you with extra functionality.
    The [url http://struts.apache.org/api/org/apache/struts/actions/package-summary.html]struts api  describes the basics of each one.
    Commoonly used ones that (to me) are of more interest:
    ForwardAction is pretty much just a placeholder that lets you specify a url to forward to when you don't want to write an entire Action.
    Dispatch action (and its siblings LookupDispatchAction, MappingDispatchAction) are most interesting because they let you use the same action for multiple events.
    In effect it is writing multiple "execute" methods in one action. The Dispatch action determines which one to call. It is useful for writing CRUD actions and keeping all that code in one class.
    Hope this helps some,
    evnafets

  • Confused re:packages

    Hi
    I have the Bronze BT package with broadband and I wanted to include Sky Sports 1, would that cost me £11.99 extra a month.
    I have got myself a bit confused with the £32.99 a month deal with getting Sky for £6.99.
    I probably pay about £32 a month now for both so should I just change it over, and is this even possible?
    Sorry, too much information to take in, got myself confused so if anyone can help a simpleton like me I would be grateful!!
    Thanks

    Hi josie,
    I can take a look at your account and check this for you, can you email me your forum username and BT account details to the email address registered against my profile (under "about me")?
    Thanks,
    Stephanie
    Stephanie
    BTCare Community Manager
    If you like a post, or want to say thanks for a helpful answer, please click on the Ratings star on the left-hand side of the post. If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

Maybe you are looking for

  • IMovie 6.0.4 vs 6.0.3???

    Does anyone know what the differences are between the two versions. If one does not like the new iMovie 08 is it worth it upgradng to iMovie 6.0.4

  • Uploading tool

    Hi, Could you please advise client’s questions as below? 1. Client want some utilities to help them to upload Intial balances GL, Vendor, Customer, Asset. Any excel format upload. 2. They want to copy GL accounts in production system from one co code

  • Populating values in jsp without submitting the form

    Hi, I have a jsp page in which i have 2 select boxes. The values to these select boxes should come from database. When i change the selection of select box, the corresponding values from database should be displayed in the other select box without su

  • Files with extension .sbc

    i recently started using vodafone email to listen to the messages but i receive them in files with extension.sbc any software to open those files and listen to my messages???

  • Database Configuration Asssistant error while installation Oracle 10g r2

    I'm try install Oracle 10g Release2 on Windos XP PRO SP2 system. I'm select in installation all options by default. Oracle software is install successfully. Then automatically run Database Configuration Assistant, that must be install example instanc