How do I use a package?

I know that instead of writing "import" you write "package."
But how do you make a package?
Do you just create a folder, put relevant .class files in there, and then type "package <folder path>" on your Java program?
Is that how it works? If someone could clarify that for me I'd appreciate it?

Answered in the duplicate thread.

Similar Messages

  • How do I use the packages tab in CQ Cloud

    In the adobe CQ cloud there is a packages tab, but I can't find my own packages only public ones, how do I find private packages ?
    AC

    Hi Matheus,
    I think you misunderstand.  Pierre replied here:
    http://forums.adobe.com/message/4591321#4591321
    and gave me access to upload my packages directly into the cloud
    Amith

  • How to make use of package "com.sapportals.wcm.repository"

    Dear all,
    I am trying to make use the package "com.sapportals.wcm.repository" in my SDK development. But when I entered "import com.sapportals.wcm.repository.*;" in my class, a error given out "The import com.sapportals.wcm cannot be resolved.". What should I do?
    Thanks
    Sam

    Hi Armin,
    Sorry that I still got problem on importing and make use of the class for knowledgemanagement. I can found the cooresponding .jar file in folder "jakarta-tomcat-3.3.2\webapps\irj\WEB-INF\plugins\portal\services\knowledgemanagement\lib". And added the services reference as "ServicesReference=htmlb, knowledgemanagement". However, I still can't use the class for KM.
    I have read those code sample from KM in SDN, but they are mentioning the programming part and not the setting. Can you suggest the detail steps and code on adding the KM class into my customize class?
    I am using Eclipse as my development tools.
    Thanks & Regards
    Sam
    Message was edited by: Sam Choy

  • How can i use UTL_SMTP package in oracle 8i 1.5

    i want to use UTL_SMTP package to send mail but i have installed oracle 8i 1.5
    i know that UTL_SMTP package come with oracle 8i 1.6
    i will send mail from eudora
    thanks

    Hi,
    Run d:/oracle/ora81/rdbms/admin/utlsmtp.sql as SYS user. It create the package UTL_SMTP.
    Hope this helps.
    rukmini

  • How do you use these packages?

    I have the files cldc_1_0_src_palm_overlay.zip and cldc_1_0_src_winsol.zip, which I was told is required for running this code:
    import java.util.*;
    import javax.microedition.io.*;
    import java.io.*;
    import com.sun.kjava.*;
    import com.sun.cldc.io.palm.comm.*;
    public class PrintMe extends Spotlet {
    public static void main(String[] args) {
    PrintMe printMe = new PrintMe();
    printMe.register(Spotlet.NO_EVENT_OPTIONS);
    printMe.doit();
    private PrintMe() {
    Graphics.clearScreen();
    public void doit() {
    String connectString = "ATI1";
    byte[] readBuffer = new byte[100];
    try {
    System.out.println("Opening port...");
    Protocol serialPort = new Protocol();
    serialPort.open("0;baudrate=9600;bitsperchar=8;stopbits=1;parity=none;autorts=off;autocts=off;blocking=off",
    1, true);
    System.out.println("...opened");
    OutputStream os = serialPort.openOutputStream();
    InputStream is = serialPort.openInputStream();
    os.write(connectString.getBytes());
    os.flush();
    System.out.println("wrote the data...");
    System.out.println("reading response...");
    int len = is.read(readBuffer);
    System.out.println("read: " + len +" bytes");
    System.out.println("[" + new String(readBuffer, 0, len) + "]");
    os.close();
    System.out.println("connection closed.");
    } catch (IOException ioe) {
    System.out.println("IO Ex: "+ioe.toString());
    } catch (IllegalArgumentException iae) {
    System.out.println("illegal argument exception: "+iae.toString());
    But i am unsure of how to use them. Do I place the files in a folder somewhere?
    Thanks in Advance

    But i am unsure of how to use them. Do I place the
    files in a folder somewhere? Where else would you keep them? :)
    Wherever you decide to put them, you need to put the path of each of the zip files into your classpath. Once the classpath points to the zip files, you should be able to import all the files in them without any problems.

  • How can I use RMI packages in J2ME?

    Hi all.
    I can not find the way to use java.rmi.server and java.rmi.activation packages.
    I know that are in the Java RMI optional Package, but I dont know where can i get it.
    Some help?
    Thanks

    Hi all.
    I can not find the way to use java.rmi.server and java.rmi.activation packages.
    I know that are in the Java RMI optional Package, but I dont know where can i get it.
    Some help?
    Thanks

  • Using Oracle package variables in JDBC.

    Can anybody know how we can use Oracle Package variable in Java/JDBC?
    I am using a insert trigger on a table which will initialize the login user
    from a package variable.In my log4j configuration file, while inserting data into this table, I am updating the user with my current user. But the insert statement is not identifying the user and it is inserting null.
    PLease let me know.

    Siva,
    You said:
    It is not inserting the user in the tableI see no table, here. Only a variable in a PL/SQL package.
    You also said:
    But the same is working in Oracle.Do you mean in SQL*Plus?
    Siva, try to forget how you are doing it, and tell me what you are trying to do.
    Do you have some UPDATE_USER column in your database tables where you record the username of the person who did the operation?
    Are you trying to write a trigger that populates this column?
    If so, then all you need is something like:
    create or replace trigger MY_TRIG
      after insert or update
      on MY_TABLE
      for each row
    begin
      :new.UPDATE_USER := user;
    end;Good Luck,
    Avi.
    P.S. By the way, what has this to do with OC4J?

  • Problem using the package Admin_Optimize.dtsx

    Hi, I am trying to use the package Admin_Optimize.dtsx but everytime that i ran it it fails, i try to openend with BIDS but i am unable to edit it, any advice that how can i use this package? or where can i find documentation related to this package? and how can i edit or modify it?, I appreciate your help.

    Hi, Harish.
    This is the situation The optimize works fine if I set it to "Lite." but it fails if It's a full optimize with compress turned on. I got the error in the Package log:
    TOTAL STEPS 1
    1.Admin_Optimize:  Failed in 363 sec.
    [Selection]
    Application=BP_Detail,Reporting,National_Plan
    OPTIMIZEOPTION=Yes
    COMPRESSDATABASE=Yes
    DEFRAGMENTINDEX=Yes
    OptimizeMinWBCount=1000
    [Messages]
    [Error][Osoft.Services.Application.OptimizeManage.OptimizeManagerCtrl]

  • How to delete data from a file using IO package

    Hi All,
    i am trying to remove some content of the file.
    this content is not at starting of file not even at end of file.
    can anybody tell me how can i delete number of lines from file using IO package.

    iam having some data in text file .ex:in flowrist.txt
    12/5/07,500,300,6000 like many set of datas are
    there.In these if i want to delete the data based on
    the date which i specified.How to do this specific
    deletion?You need to open a stream to read in the file and then use the indexOf method provided in the Sting class to check if the line contains the date or whatever String you are looking for, if so then skip that line and store or re-write the lines you wish to keep, as well as some extra lines you may wish to add.
    Take a look below at this example found on Google.
    http://www.java-tips.org/java-se-tips/java.io/how-to-read-file-in-java.html
    The above read a file line by line and prints it to console. You should be able to modify this, instead of using System.out to print the line you should use index of to check the lines for a date/String. Index of return -1 if the String you specify is not in the line you parse.

  • How do I create and use a package?

    Sorry for the noobish question, but I have never had the need to use a package and currently would like to learn how they work just to satisfy my own curiosity.
    Suppose I have a file named Node.class in a folder named Classes, and I have another class named Main.class sitting in another folder. I want to create a Node object using the Main class.
    How do I accomplish that? Would I need to use a package?
    I tried to write package Classes; on my Main file but it did not work. thanks

    This is an old explanation I wrote:
    This is a minimal explanation of packages.
    Assume that your programs are part of a package named myapp, which is specified by this first line in each source file:
    package myapp;
    Also assume that directory (C:\java\work\) is listed in the CLASSPATH list of directories.
    Also assume that all your source files reside in this directory structure: C:\java\work\myapp\
    Then a statement to compile your source file named aProgram.java is:
    C:\java\work\>javac myapp\aProgram.java
    And a statement to run the program is:
    java myapp.aProgram
    (This can be issued from any directory, as Java will search for the program, starting the search from the classpath directories.)
    Explanation:
    Compiling
    A class is in a package if there is a package statement at the top of the class.
    The source file needs to be in a subdirectory structure. The subdirectory structure must match the package statement. The top subdirectory must be in the classpath directory.
    So, you generate a directory structure C:\java\work\myapp\ which is the [classpath directory + the package subdirectory structure], and place aProgram.java in it.
    Then from the classpath directory (C:\java\work\) use the command: javac myapp\aProgram.java
    Running
    Compiling creates a file, aProgram.class in the myapp directory.
    (The following is where people tend to get lost.)
    The correct name now, as far as java is concerned, is the combination of package name and class name: myapp.aProgram (note I omit the .class) If you don't use this name, java will complain that it can't find the class.
    To run a class that's NOT part of a package, you use the command: java SomeFile (assuming that SomeFile.class is in a directory that's listed in the classpath)
    To run a class that IS part of a package, you use the command java myapp.aProgram (Note that this is analogous to the command for a class not in a package, you just use the fully qualified name)

  • How can I use 3D function in Photoshop CS6 (student package)?

    Please let me know how can I use 3D function in Photoshop CS6 (student package)?
    Thanks,

    Thanks so much for your helpful reply.
    Now I' ve already installed Adobe Creative Suite 6 Production Premium (Student Package), Extended included. But when I open Photoshop CS6, there' s still no 3D function in menu bar.
    Would you please tell me how to activate this function?
    Thanks,

  • How to make use of 32bit packages on Arch64

    Hello everyone, I recently installed arch 64bit which was not yet fully tweaked to suit my needs. 
    My 32bit version has some nice apps and I would like to know how to make use of them or even reuse them so that I won't download things anymore because I have a slow internet connection...:)
    Arch x86_64 / XFCE4
    Thanks in advance
    Last edited by kaola_linux (2008-12-09 15:24:36)

    kaola_linux wrote:
    Hello everyone, I recently installed arch 64bit which was not yet fully tweaked to suit my needs. 
    My 32bit version has some nice apps and I would like to know how to make use of them or even reuse them so that I won't download things anymore because I have a slow internet connection...:)
    Arch x86_64 / XFCE4
    Thanks in advance
    You can reuse the packages in /var/cache/pacman/pkg/ on your  Arch32.
    You can use these saved packages in a 32bit chroot ENV on your Arch64. Just pacman -U all of them.

  • How to use stored package in form.

    hi
    i created the following package but now i want to use the following code in form
    how could i use?.
    create or replace package body mahi
    is
    -- Write a MIME header
    procedure write_mime_header (
    p_conn in out nocopy utl_smtp.connection
    , p_name in varchar2
    , p_value in varchar2
    is
    begin
    utl_smtp.write_data ( p_conn
    , p_name || ': ' || p_value || utl_tcp.crlf
    end;
    procedure mail (
    p_sender in varchar2
    , p_recipient in varchar2
    , p_subject in varchar2
    , p_message in varchar2
    is
    v_nls_charset VARCHAR2(50);
    /*LOB operation related varriables */
    v_src_loc BFILE := BFILENAME('BACKUP', 'Logon.jpg');
    l_buffer RAW(54);
    l_amount BINARY_INTEGER := 54;
    l_pos INTEGER := 1;
    l_blob BLOB := EMPTY_BLOB;
    l_blob_len INTEGER;
    v_amount INTEGER;
    /*UTL_SMTP related varriavles. */
    v_connection_handle UTL_SMTP.CONNECTION;
    v_from_email_address VARCHAR2(30) := [email protected]';
    v_to_email_address VARCHAR2(30) := '[email protected]';
    I have used stunnel to send mail using smtp.gmail.com
    To get stunnel see http://stunnel.org/.
    The ORIGINAL idea is here :
    http://monkeyonoracle.blogspot.com/2009/11/plsql-and-gmail-or-utlsmtp-with-ssl.html
    v_smtp_host VARCHAR2(30) := 'localhost.localdomain';
    v_subject VARCHAR2(30) := 'Your Test Mail';
    l_message VARCHAR2(200) := 'This is test mail using UTL_SMTP';
    /* This send_header procedure is written in the documentation */
    PROCEDURE send_header(pi_name IN VARCHAR2, pi_header IN VARCHAR2) AS
    BEGIN
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    pi_name || ': ' || pi_header || UTL_TCP.CRLF);
    END;
    BEGIN
    SELECT value
    INTO v_nls_charset
    FROM nls_database_parameters
    WHERE parameter = 'NLS_CHARACTERSET';
    /*Preparing the LOB from file for attachment. */
    DBMS_LOB.OPEN(v_src_loc, DBMS_LOB.LOB_READONLY); --Read the file
    DBMS_LOB.CREATETEMPORARY(l_blob, TRUE); --Create temporary LOB to store the file.
    v_amount := DBMS_LOB.GETLENGTH(v_src_loc); --Amount to store.
    DBMS_LOB.LOADFROMFILE(l_blob, v_src_loc, v_amount); -- Loading from file into temporary LOB
    l_blob_len := DBMS_LOB.getlength(l_blob);
    /*UTL_SMTP related coding. */
    v_connection_handle := UTL_SMTP.OPEN_CONNECTION(host => v_smtp_host,
    port => 1925);
    UTL_SMTP.EHLO(v_connection_handle, 'gmail.com');
    UTL_SMTP.COMMAND(v_connection_handle, 'auth login');
    UTL_SMTP.COMMAND(v_connection_handle,
    UTL_ENCODE.TEXT_ENCODE('[email protected]',
    v_nls_charset,
    1));
    UTL_SMTP.COMMAND(v_connection_handle,
    UTL_ENCODE.TEXT_ENCODE('xxxxx', v_nls_charset, 1));
    --UTL_SMTP.MAIL(v_connection_handle, v_from_email_address);
    --UTL_SMTP.RCPT(v_connection_handle, v_to_email_address);
    UTL_SMTP.COMMAND(v_connection_handle,
    'MAIL FROM: <'>');
    UTL_SMTP.COMMAND(v_connection_handle,
    'RCPT TO: <'>');
    UTL_SMTP.OPEN_DATA(v_connection_handle);
    send_header('From', '"Sender" <'>');
    send_header('To', '"Recipient" <'>');
    send_header('Subject', v_subject);
    --MIME header.
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    'MIME-Version: 1.0' || UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    'Content-Type: multipart/mixed; ' || UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    ' boundary= "' || 'BACKUP.SECBOUND' || '"' ||
    UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
    -- Mail Body
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    '--' || 'BACKUP.SECBOUND' || UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    'Content-Type: text/plain;' || UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    ' charset=US-ASCII' || UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle, l_message || UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
    -- Mail Attachment
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    '--' || 'BACKUP.SECBOUND' || UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    'Content-Type: application/octet-stream' ||
    UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    'Content-Disposition: attachment; ' || UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    ' filename="' || 'Logon.jpg' || '"' || --My filename
    UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    'Content-Transfer-Encoding: base64' || UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
    /* Writing the BLOL in chunks */
    WHILE l_pos < l_blob_len LOOP
    DBMS_LOB.READ(l_blob, l_amount, l_pos, l_buffer);
    UTL_SMTP.write_raw_data(v_connection_handle,
    UTL_ENCODE.BASE64_ENCODE(l_buffer));
    UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
    l_buffer := NULL;
    l_pos := l_pos + l_amount;
    END LOOP;
    UTL_SMTP.WRITE_DATA(v_connection_handle, UTL_TCP.CRLF);
    -- Close Email
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    '--' || 'BACKUP.SECBOUND' || '--' || UTL_TCP.CRLF);
    UTL_SMTP.WRITE_DATA(v_connection_handle,
    UTL_TCP.CRLF || '.' || UTL_TCP.CRLF);
    UTL_SMTP.CLOSE_DATA(v_connection_handle);
    UTL_SMTP.QUIT(v_connection_handle);
    DBMS_LOB.FREETEMPORARY(l_blob);
    DBMS_LOB.FILECLOSE(v_src_loc);
    EXCEPTION
    WHEN OTHERS THEN
    UTL_SMTP.QUIT(v_connection_handle);
    DBMS_LOB.FREETEMPORARY(l_blob);
    DBMS_LOB.FILECLOSE(v_src_loc);
    RAISE;
    END;
    end;
    sarah helped me to create the above package but i am not able to use in form
    i sent email to her but no reply.

    hi
    mehwish............just do for attachment.......
    u can also use something like this...
    Execute send_mail;and also.
    try something like this..
    example:
    begin
    mahi.mail('email address','subject','message','attachment');
    end;Edited by: Sarah on Apr 18, 2011 10:25 AM

  • How can we use the same package in our report used by some other report

    how can we use the same package in our report used by some other report

    Hi,
    You just need to assign package while saving your report.
    No extra is required providing you are aware of package to be used.

  • How to find length of string after encryption using DBMS_CRYPTO package

    Hi,
    I am planning do data encryption using DBMS_CRYPTO package. I want to find how much will be string length after encryption.
    e.g When I try to encrypt string of length between 1-15 characters it gives me encrypted string of 32 characters. When I try with 16 charcters encrypted string is of 64 characters.
    Is ther any formula to calculate length of encrypted string?
    Thanks
    Pravin

    The length change is dependent upon the algorithm you are using which can be a combination of cipher block, padding, and chaining.
    The best solution is determine the method you are going to use and apply it to the l ongest possible strings you are going to proces, then add some safety margin. There iis no penalty for defining your column as VARCHAR2(4000).

Maybe you are looking for

  • When I click a link it won't open up another window, what do I do?

    There is a website I use for my business and when I select several items on the main page to produce a report nothing happens. On my old pc the report would open in another window. Nothing happens with my new macbook pro. Why won't the report open?

  • Value mapping details

    Hi all, Can cnybody give me details about the Value mappings in XI. I want basic details like where and how to declare it and how to use it. Regards, Guru.

  • Any way to set global variables except EAS console?

    Hi pros, I am searching for a way to set global variables (used by business rules) automatically. I got several variables which should change each month. I know the rule to set them. However, I cannot find any way to set them through scripting or som

  • Difference Compositing Question - Please help me and my daughter

    Hey guys, I am trying to do something that is probably very simple but I can not figure it out. I have 3 clips: 1. 1 minute clip of empty room. 2. 1 minute clip of my daughter running in and hiding. 3. 1 minute clip of my daughter running in and look

  • Pr CS5 rendering HD ?

    Hello I am for the first time on this forum and I am so happy, how I can see you have a lot exchange of experience, helpful stories etc. My Question to all of you is ???? IS possible one project who is recorded with Canon XL1-DV and after edited in P