Trying to understand creating and using packages

Hi all,
I do not understand this problem... Package "shared.utilities" is an entire separate package from "alertsystem". When I comment out "package alertsystem", I get C:\Wdt\alertsystem\File_Handling.java:4: package shared.utilities does not exist
import shared.utilities.*;
^
Below is the code
// package alertsystem;
import shared.utilities.*;
import java.io.*;
import java.util.*;
import java.text.*;
class File_Handling
     private long time_buff;
     private String alertDir;
     private String archPath;
     private SData buff;
On the other hand, if I do NOT comment out "package alertsystem", no problem. I do not understand why I need to include "package alertsystem". If I am writing a simple module and want to use one of the library in "shared.utilities", do I always need to make sure all my codes come under a package?
Thanks in advance.

Hi,
This is funny... if I do this....
package alertsystem;
import shared.utilities.*;
import java.io.*;
import java.util.*;
import java.text.*;
class File_Handling
     private long time_buff;
     private String alertDir;
without including the path to the jar file, NO PROBLEM during compilation and run (in this case, util.jar, which is actually the shared.utilities package). But, if I do
// package alertsystem;
import shared.utilities.*;
import java.io.*;
import java.util.*;
import java.text.*;
I still get the same error problem...
C:\Wdt\alertsystem\File_Handling.java:4: package shared.utilities does not exist
import shared.utilities.*;
In other words, if I include or I do not include the path of to the jar file and do this...
package alertsystem;
import shared.utilities.*;
import java.io.*;
import java.util.*;
import java.text.*;
Then, No problem with compilation and running. However, if I do not include "package alertsystem", I get compilation problem.
The jar file consists only of *.class files that I have compiled without a single problem. I included "package shared.utilities;" in all the files of the util.jar
Funny isn't it?
Thanks for responding.
Hi,
What's your classpath look like when you compile when
you include the package and when you don't include the
package? Is it when you compile or run the code?

Similar Messages

  • When trying to move file and use command and drag, it doesn't move the file just creates a short cut.

    When trying to move file and use command and drag, it doesn't move the file just creates a short cut.

    Using command creates a copy.
    If you want to just move a file, click on it, hold it and drag it to the new location.

  • How to create and use dynamic queue in JMS

    Plz tell me how to create and use a dynamic queue in jms and can reciever file lookup it as it lookup any server configurred queue(written in the server).

    Hi,
    We can use Azure File services to do this, for more information, please have a look at this article:
    http://blogs.msdn.com/b/windowsazurestorage/archive/2014/05/12/introducing-microsoft-azure-file-service.aspx. The Azure File service exposes file shares using the standard SMB 2.1 protocol. Applications running in Azure can now easily share files between
    VMs using standard and familiar file system APIs like ReadFile and WriteFile.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Understanding row_number() and using it in an analytic function

    Dear all;
    I have been playing around with row_number and trying to understand how to use it and yet I still cant figure it out...
    I have the following code below
    create table Employee(
        ID                 VARCHAR2(4 BYTE)         NOT NULL,
       First_Name         VARCHAR2(10 BYTE),
       Last_Name          VARCHAR2(10 BYTE),
        Start_Date         DATE,
        End_Date           DATE,
         Salary             Number(8,2),
       City               VARCHAR2(10 BYTE),
        Description        VARCHAR2(15 BYTE)
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary,  City,       Description)
                 values ('01','Jason',    'Martin',  to_date('19960725','YYYYMMDD'), to_date('20060725','YYYYMMDD'), 1234.56, 'Toronto',  'Programmer');
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary,  City,       Description)
                  values('02','Alison',   'Mathews', to_date('19760321','YYYYMMDD'), to_date('19860221','YYYYMMDD'), 6661.78, 'Vancouver','Tester')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary,  City,       Description)
                 values('03','James',    'Smith',   to_date('19781212','YYYYMMDD'), to_date('19900315','YYYYMMDD'), 6544.78, 'Vancouver','Tester')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary,  City,       Description)
                  values('04','Celia',    'Rice',    to_date('19821024','YYYYMMDD'), to_date('19990421','YYYYMMDD'), 2344.78, 'Vancouver','Manager')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary,  City,       Description)
                  values('05','Robert',   'Black',   to_date('19840115','YYYYMMDD'), to_date('19980808','YYYYMMDD'), 2334.78, 'Vancouver','Tester')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary, City,        Description)
                  values('06','Linda',    'Green',   to_date('19870730','YYYYMMDD'), to_date('19960104','YYYYMMDD'), 4322.78,'New York',  'Tester')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary, City,        Description)
                  values('07','David',    'Larry',   to_date('19901231','YYYYMMDD'), to_date('19980212','YYYYMMDD'), 7897.78,'New York',  'Manager')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary, City,        Description)
                   values('08','James',    'Cat',     to_date('19960917','YYYYMMDD'), to_date('20020415','YYYYMMDD'), 1232.78,'Vancouver', 'Tester')I did a simple select statement
    select * from Employee e
    and it returns this below
    ID   FIRST_NAME LAST_NAME  START_DAT END_DATE      SALARY CITY       DESCRIPTION
    01   Jason      Martin     25-JUL-96 25-JUL-06    1234.56 Toronto    Programmer
    02   Alison     Mathews    21-MAR-76 21-FEB-86    6661.78 Vancouver  Tester
    03   James      Smith      12-DEC-78 15-MAR-90    6544.78 Vancouver  Tester
    04   Celia      Rice       24-OCT-82 21-APR-99    2344.78 Vancouver  Manager
    05   Robert     Black      15-JAN-84 08-AUG-98    2334.78 Vancouver  Tester
    06   Linda      Green      30-JUL-87 04-JAN-96    4322.78 New York   Tester
    07   David      Larry      31-DEC-90 12-FEB-98    7897.78 New York   Manager
    08   James      Cat        17-SEP-96 15-APR-02    1232.78 Vancouver  TesterI wrote another select statement with row_number. see below
    SELECT first_name, last_name, salary, city, description, id,
       ROW_NUMBER() OVER(PARTITION BY description ORDER BY city desc) "Test#"
       FROM employee
       and I get this result
    First_name  last_name   Salary         City             Description         ID         Test#
    Celina          Rice         2344.78      Vancouver    Manager             04          1
    David          Larry         7897.78      New York    Manager             07          2
    Jason          Martin       1234.56      Toronto      Programmer        01          1
    Alison         Mathews    6661.78      Vancouver   Tester               02          1 
    James         Cat           1232.78      Vancouver    Tester              08          2
    Robert        Black         2334.78     Vancouver     Tester              05          3
    James        Smith         6544.78     Vancouver     Tester              03          4
    Linda         Green        4322.78      New York      Tester             06           5
    I understand the partition by which means basically for each associated group a unique number wiill be assigned for that row, so in this case since tester is one group, manager is another group, and programmer is another group then tester gets its own unique number for each row, manager as well and etc.What is throwing me off is the order by and how this numbering are assigned. why is
    1 assigned to Alison Mathews for the tester group and 2 assigned to James Cat and 3 assigned Robert Black
    I apologize if this is a stupid question, i have tried reading about it online and looking at the oracle documentation but that still dont fully understand why.

    user13328581 wrote:
    understanding row_number() and using it in an analytic functionROW_NUMBER () IS an analytic fucntion. Are you trying to use the results of ROW_NUMBER in another analytic function? If so, you need a sub-query. Analuytic functions can't be nested within other analytic functions.
    ...I have the following code below
    ... I did a simple select statementThanks for posting all that! It's really helpful.
    ... and I get this result
    First_name  last_name   Salary         City             Description         ID         Test#
    Celina          Rice         2344.78      Vancouver    Manager             04          1
    David          Larry         7897.78      New York    Manager             07          2
    Jason          Martin       1234.56      Toronto      Programmer        01          1
    Alison         Mathews    6661.78      Vancouver   Tester               02          1 
    James         Cat           1232.78      Vancouver    Tester              08          2
    Robert        Black         2334.78     Vancouver     Tester              05          3
    James        Smith         6544.78     Vancouver     Tester              03          4
    Linda         Green        4322.78      New York      Tester             06           5... What is throwing me off is the order by and how this numbering are assigned. why is
    1 assigned to Alison Mathews for the tester group and 2 assigned to James Cat and 3 assigned Robert Black That's determined by the analytic ORDER BY clause. Yiou said "ORDER BY city desc", so a row where city='Vancouver' will get a lower namber than one where city='New York', since 'Vancouver' comes after 'New York' in alphabetic order.
    If you have several rows that all have the same city, then you can be sure that ROW_NUMBER will assign them consecutive numbers, but it's arbitrary which one of them will be lowest and which highest. For example, you have 5 'Tester's: 4 from Vancouver and 1 from New York. There's no particular reason why the one with first_name='Alison' got assinge 1, and 'James' got #2. If you run the same query again, without changing the table at all, then 'Robert' might be #1. It's certain that the 4 Vancouver rows will be assigned numbers 1 through 4, but there's no way of telling which of those 4 rows will get which of those 4 numbers.
    Similar to a query's ORDER BY clause, the analytic ORDER BY clause can have two or more expressions. The N-th one will only be considered if there was a tie for all (N-1) earlier ones. For example "ORDER BY city DESC, last_name, first_name" would mena 'Vancouver' comes before 'New York', but, if multiple rows all have city='Vancouver', last_name would determine the order: 'Black' would get a lower number than 'Cat'. If you had multiple rows with city='Vancouver' and last_name='Black', then the order would be determined by first_name.

  • HT204407 my 2 daughters and I are sharing one icloud.  I am trying to set up and use find my friends with them, but it won't let me.  It says I can't send a request to myself when I send one to her email address, which is different than mine.  What am I d

    my two daughters and I have iphones.  I am trying to set up and use find my friends with them. We have 1 icloud, but different emails.  When I send a request it states that I can't send a request to myself.  What am I doing wrong

    Sharing an Apple ID is never recommended for these reasons.
    They can create their own: http://appleid.apple.com and you can add them at the addresses they use for their ID.
    Sharing an Apple ID is not recommended because all of your data gets merged and when it gets deleted from one device, it deletes from them all, such as Contacts.
    iCloud Guide

  • I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?

    I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?
    I have tried back ups and  restoring, resetting, and even updating the pages app. And nothing has worked.

    I have an ipad mini. From one moment to another a document that was created and used on pages app ( on the ipad mini) does not want to open ( When pressed it states " document cant be opened). How can I make this document open again?
    I have tried back ups and  restoring, resetting, and even updating the pages app. And nothing has worked.

  • Re: How do you create and use "common" type classes?

    Hi,
    You have 2 potential solutions in your case :
    1- Sub-class TextNullable class of Framework and add your methods in the
    sub-class.
    This is the way Domain class work. Only Nullable classes are sub-classable.
    This is usefull for Data Dictionary.
    The code will be located in any partition that uses or references the supplier
    plan.
    2- Put your add on code on a specific class and instanciate it in your user
    classes (client or server).
    You could also use interface for a better conception if needed. The code will
    also be in any partition that uses or references the supplier plan where your
    add on class is located.
    If you don't want that code to be on each partition, you could use libraries :
    configure as library the utility plan where is your add-on class.
    You can find an example of the second case (using a QuickSort class,
    GenericArray add-on) with the "QuickSort & List" sample on my personal site
    http://perso.club-internet.fr/dnguyen/
    Hope this helps,
    Daniel Nguyen
    Freelance Forte Consultant
    http://perso.club-internet.fr/dnguyen/
    Robinson, Richard a écrit:
    I'm relatively new to forte and I'd like to know how can you handle utility
    type classes that you want to use through out your application? Ideally
    what I want is a static class with static methods.
    Let's say that I have a StringUtil class that has a bunch of methods for
    manipulating strings.
    My problem is that we have code that runs on the client and code that runs
    on the server. Both areas could use the StringUtil class, but from what I
    understand, I have to create StringUtil in a plan and then create a server
    object of type StringUtil. The server object will eventually get assigned
    to a partition. That's not good since I really want the server object to
    physically reside at the server end and at the client end. (Actually, I
    don't want a server object, I just want to invoke a static method of a
    static class).
    Any clues on how to solve this problem would be appreciated.
    Also, what is the url at Sage-it that has a summary of all emails that have
    been posted to [email protected]? Perhaps this question has been
    answered previously.
    Thanks in advance
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi Richard,
    Your question about "utility classes" brings up a number of issues, all of
    which are important to long-term success with Forte.
    There is no such thing as a static method (method that is associated with a
    class but without an implicit object reference - this/self/me "pointer") in
    TOOL, nor is there such thing as a global method (method not associated
    with a class at all). This is in contrast to C++, which has both, and
    Java, which has static methods, but not global classes. Frequently, Forte
    developers will write code like this:
    result, num : double;
    // get initial value for num....
    tmpDoubleData : DoubleData = new;
    tmpDoubleData.DoubleValue = num;
    result = tmpDoubleData.Sqrt().DoubleValue;
    tmpDoubleData = NIL; // send a hint to the garbage collector
    in places where a C++ programmer would write:
    double result, num;
    // get initial value for num....
    result = Math::Sqrt(num);
    or a Java programmer would write:
    double result, num;
    // get initial value for num....
    result = Math.sqrt(num);
    The result of this is that you end up allocating an extra object now and
    then. In practice, this is not a big deal memory-wise. If you have a
    server that is getting a lot of hits, or if you are doing some intense
    processing, then you could pre-allocate and reuse the data object. Note
    that optimization has its own issues, so you should start by allocating
    only when you need the object.
    If you are looking for a StringUtil class, then you will want to use an
    instance of TextData or TextNullable. If you are looking to add methods,
    you could subclass from TextNullable, and add methods. Note that you will
    still have to instantiate an object and call methods on that object.
    The next issue you raise is where the object resides. As long as you do
    not have an anchored object, you will always have a copy of an object on a
    partition. If you do not pass the object in a call to another partition,
    the object never leaves. If you pass the object to another partition, then
    the other partition will have its own copy of the object. This means that
    the client and the server will have their own copies, which is the effect
    you are looking for.
    Some developers new to Forte will try to get around the lack of global
    methods in TOOL by creating a user-visible service object and then calling
    methods on it. If you have a general utility, like string handling, this
    is a bad idea, since a service object can reside only on a single
    partition.
    Summary:
    * You may find everything you want in TextData.
    * Unless you anchor the object, the instance will reside where you
    intuitively expect it.
    * To patch over the lack of static methods in TOOL, simply allocate an
    instance when required.
    Feel free to email me if you have more questions on this.
    At the bottom of each message that goes through the mailing list server,
    the address for the list archive is printed:
    http://pinehurst.sageit.com/listarchive/.
    Good Luck,
    CSB
    -----Original Message-----
    From: Robinson, Richard
    Sent: Tuesday, March 02, 1999 5:44 PM
    To: '[email protected]'
    Subject: How do you create and use "common" type classes?
    I'm relatively new to forte and I'd like to know how can you handle utility
    type classes that you want to use through out your application? Ideally
    what I want is a static class with static methods.
    Let's say that I have a StringUtil class that has a bunch of methods for
    manipulating strings.
    My problem is that we have code that runs on the client and code that runs
    on the server. Both areas could use the StringUtil class, but from what I
    understand, I have to create StringUtil in a plan and then create a server
    object of type StringUtil. The server object will eventually get assigned
    to a partition. That's not good since I really want the server object to
    physically reside at the server end and at the client end. (Actually, I
    don't want a server object, I just want to invoke a static method of a
    static class).
    Any clues on how to solve this problem would be appreciated.
    Also, what is the url at Sage-it that has a summary of all emails that have
    been posted to [email protected]? Perhaps this question has been
    answered previously.
    Thanks in advance

  • How to create and use mutable array of UInt8

    Hello!
    If I get it right, UInt8 *buffer, buffer - is a pointer to a start of array?
    Then how to create and use mutable array of UInt8 pointers?
    The main target is a creation of the module that will store some byte array requests and will send all of them at the propriate moment.

    I try
    - (void) scheduleRequest:(UInt8 *)request {
    if (!scheduledRequests) scheduledRequests = [[NSMutableArray array] retain];
    [scheduledRequests addObject:request];
    But get warning:"passing argument 1 of 'addObject:' from incompatible pointer type"

  • HOW TO CREATE  and  USE EVENTS IN WORKFLOWS .

    HOW TO CREATE  and  USE EVENTS IN WORKFLOWS with the help of classes.
    What i am doing is..
    open se24
    event tab->event name->parameters
    method tab->method name->event handler->copy parameters
    interface tab->if_workflow->enter
    tell me what else to do step by step
    Another important thing is that HOW to use these class events to trigger the workflows.
    REPLY ASAP
    THXS IN ADVANCE

    Hi,
    Pl. see this blog...
    Raising ABAP OO events for workflow
    Regards,
    JOy.

  • How to Create  and use of Coherence servers in weblogic serevr 11g (10.3.6)?

    how to Create  and use of Coherence servers in weblogic serevr 11g (10.3.6)?

    See the below discussion
    How to create and use Webservice controls using WSDL in weblogic portal10.3
    Thanks,
    Venkat Sarvabatla

  • Can I create and use more than one repository on OVM 2.1.5

    The version of Oracle VM I am using is 2.1.5 .
    I wonder can I create and use more than one repository on OVM 2.1.5. Because I want to install different GOS on different disks.
    I know in Oracle VM 2.2 we can use following commands to realize that.
    a. #/opt/ovs-agent-2.3/utils/repos.py –n /dev/mapper/mpathxp1
    b. #/opt/ovs-agent-2.3/utils/repos.py –r UUID
    c. #/opt/ovs-agent-2.3/utils/repos.py –i
    And other repositories can also be mounted and found under /var/ovs/mount/UUID.
    But in Oracle VM 2.1.5, seems just one repository can be created and mounted. For example:
    At first, I create a repository using mpath1p1:
    a. # mkfs.ocfs2 /dev/mapper/mpath1p1
    b. #/usr/lib/ovs/ovs-makerepo /dev/mapper/mpath1p1 C "cluster root"
    c. I can find the repository has been mounted under /OVS.
    But if I want to use "/usr/lib/ovs/ovs-makerepo /dev/mapper/mpath2p1 C "cluster root" to create another repository, and check the mount status using command "mount", these two disks are all have been mounted under /OVS.
    "# cat /etc/ovs/repositories", only mpath1p1 with UUID was recorded there.
    After reboot, only repository with mpath1p1 was mounted under OVS.
    Can anyone tell me how to use more than one repositories on OVM 2.1.5. Do I have to install all the GOSs on the same disk and repository.
    Thank you very much.

    Now I've known how to create different repository. They will be mounted under /OVS/UUID. Thanks.

  • One structure is created and using in 3 queries, i want to modify that stru

    hi gurus,
    one structure is created and using in 3 queries, i want to modify that structure in only one query but it will not effect other two.wat should i do for that?
    thanx in advace,
    i will assign points,
    srinivas.

    Hi srinivas,
       This scenario could be frequently seen in a project. I assume the structure you mentioned is saved as a global structure, then in the query which you want to modify, right click on the structure and choose "Remove Reference". This function copies the global structure to a local one, in which you can change it and the other two won't get affected.
       Hope this helps.
    Regards,
    Aaron

  • SQL08 Need example of creating AND using a Fact (degenerate) dimension

    Can someone post a link to some examples of setting up and using a Fact (degenerate) dimension.  Ive got the SSAS 2008R2 Adventureworks DW project setup and I see a few Fact dimensions in there, but id like some descriptions to go along with this or
    something similar.
    My scenario:
    Orders - attributes include :  Order#, OrderStartDate, SalesPerson, BusinessType, MarketType
    OrderTransactions - attributes include:  OrderKey , TransactionAmount, TransactionType, TransactionDate, AccountKey
    Description:
    Its more or less the typical Order > Order Detail type scenario, with the addition of Orders have some additional attributes.
    So I want to be able to measure on for example:
    Order counts - broken down by BusinessType and MarketType , and then within a date range
    Revenue - which will be totals of transaction amounts, again grouped by BusinessType and MarketType, but also be able to drill down to see the related Order#

    Hi Shiftbit,
    According to your description, you need some examples about create and use degenerate dimensions, right?
    Degenerate dimensions, also called fact dimensions, are standard dimensions that are constructed from attribute columns in fact tables instead of from attribute columns in dimension tables. Here is document that describes how to create and use degenerate
    dimensions step by step, please refer to the links below.
    https://msdn.microsoft.com/en-us/library/ms167409(v=sql.100).aspx
    http://www.jamesserra.com/archive/2011/11/degenerate-dimensions/
    Regards,
    Charlie Liao
    TechNet Community Support

  • How do I create and use a watermark in aperture?

    Hello there!
    How to I create and use a watermark in aperture? do I need to download a 3rd party plugin? Any recommendations?
    Thank you!

    Aperture does not support the creation of watermarks; if you want a watermark image with transparent regions you need an application that can handle alpha channels - Prewiew, Photoshop, Pixelmator, Gimp, just to name a few.
    But once you have a watermark image, you can add it to an image, when you export from Aperture. Add the watermark to one of the Export Presets. You will need to create your watermark in different sizes, so you can add it to each of the export pixel sizes for your images, that you are using.
    Another possibility would be using the BorderFX plugin. This versatile plug-in also supports to add graphic overlays to your images, either when exporting or as an Edit plug-in.  http://www.iborderfx.com/BorderFX

  • How do I create and use a ringtone without syncing and without jailbreaking?

    How do I create and use a ringtone without syncing and without jailbreaking?

    You create ringtones on your computer and sync them to your iphone.
    You can buy ringtones from the ringtones section (at the bottom of the screen when you open itunes) of the itunes app on your iphone.
    There may be apps that will do this - not sure.

Maybe you are looking for

  • Is there a jabber client for windows users that's working?

    hello all, i've just deployed os x server 10.5 (standard configuration, upgraded to 10.5.3) and i have some users that are using ms windows. i can't seem to get google talk or any other windows jabber clients to successfully connect to the ichat serv

  • Mac Mini: DVI+TOSlink- HDMI Adapter, still fiction?

    Hello I've been studying for a while the best solution for connecting my early 2009 Mac Mini to my LCD TV and Blu-Ray 5.1 System. I didn't took long to figure out the "Mini-DVI->HDMI Adaptor for video" and "Mini-TOS->TOSlink for audio" scenario. The

  • Error Message when delivery qty more then po qty in MV50AFZ1

    Hi Sap Gurus, I gt a requirement  that while creating deliveries in vl02n if delivery quantity greater then po qty it should through error but i have alredy done coding in mv50afz1 user exit its working fine. My problem is if delivery no is differnt

  • Default Interface Namespace

    Sender SOAP Adapter there is a mandatory field asking for "Default Interface Namespace " and " Default Interface Name ". What should we enter there ? Does webservices always use Application xml ? How would we find out they are expecting " Application

  • Have Xdb Return Snippet

    Here is my version of Oracle and Sqlplus SQL*Plus: Release 11.2.0.1.0 Production on Mon Jun 27 09:47:51 2011 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Produc