How to make a package and import it later

Hi folks,
this is a very basic question but it is not working to me so i will appreciate your comments.
I had programmed many classes that are going to be used in many projects so they must be part of a library. Tell me whether or not this procedure is correct ?
Compile those classes into .class files. Create a package with the jar application putting the .class files into a single file called my_utils ( .jar or .zip ?). Import the package from other projects using the import directive and storing the my_utils file in the project's library directory. Is this correct ?
Many thanks in advance
Marla.

If you want to create a package and then put the package into a jar file, first compile into .class files (in appropriate package directories), then jar all of the .class files.
Here's a link for a tutorial on packages. http://java.sun.com/docs/books/tutorial/java/interpack/packages.html
Here's a link for a jar file tutorial. http://java.sun.com/docs/books/tutorial/jar/index.html
You do not have put the .class files into a jar. Java packages are used for organizing classes, managing class name space, and controlling access to classes. Java jar files are a way to put multiple classes into a single file while compressing the content. Jar files can contain multiple packages and packages do not have to be inside of jar files.

Similar Messages

  • How to make a movieclip and import it to another fla file ?

    Hi,
    I am having one of those 'self doubt sanity' moments.
    Entering melt down here !
    I want to make a movieclip from a graphic map background, and some existing movieClips that reside in another .fla
    In this other .fla file the movieclips are in the wrong layer so by starting over I wish to tidy things up.
    How do I create a movie clip from such ?
    Then I start thinking, how does one create a movie clip, then bring it into another file ?
    I even did a test that went:-
    1) create new AS3 file
    2) draw a box
    3) select box and hit F8 Convert to symbol, select movieclip and name it box_movieclip
    4) d/click box and made a classic tween and had box moving across stage.
    5) save as and named file MovieClip_Boxtest.fla
    6) open new file AS3 and import to library the BoxTween.fla  and got a message saying One or more files not imported as problems reading them.
    So having done the above stages 1 to 5 which made a movieclip, how do I get that into another fla file ?
    having done this before I am panicking that I have lost some brain cells !
    Envirographics.

    When I want to move a movieclip from one fla to another I just right click it in the library and select copy.  Then I go to the library of the other fla, right click the library (off any other symbols) and select paste.

  • How to create package and import from jar file?

    Hi all,
    I am writing a software and I am not sure how to create a package for the classes.
    Say I have two classes in the same directory as follows:
    testA.java
    ==========
    package AB;
    public class testA
    public static void main(String[] args){
         testB myB = new testB();
         System.out.println("A test");
    testB.java
    ===========
    package AB;
    public class testB
    public testB(){
         System.out.println("B constructor");
    both file compile without the package heading;
    both file compile using: javac -classpath .\ *.java
    Question 1:
    I cannot run testA by: java -classpath .\ testA
    I think it is a syntax error. What is the correct one?
    If I run testA by: java testA
    The only output I get is: A test
    But I am expecting: B constructor /n A test
    What went wrong?
    Question 2:
    I need to use APIs of another software. I have downloaded a .jar file (xxx.jar) with all the classes in it. And I have put "import xxx.*;" in my source file. But the compiler complains about the importing. What is the right way to copmile it?
    I have read a couple of tutorials but they don't answer my question.
    (I am using windows2000 and don't have the classpath variable.)
    Hope some one can help.
    Thanks a lot

    Try moving testA out of the package and importing 'AB.*;'
    If you have:
    ./testA.class
    ./AB/testb.class
    Then to execute testA from ./ type: java -cp . testA

  • How to make Sales group and office field mandatory in VA01 first screen

    hi gurus,
    can anybody tell me how to make Sales group and sales office mandatory field on VA01 tcode first screen. i have requirement to make it compulsary on the first screen otherwise they wont be able to goto next screen.
    will reward points for sure
    thanks
    mandy

    Hi! Mandy,
    Try using t.code SHD0, choose your transaction variant here, further choose your screen variant.
    Next select your screen variant and in the Menu bar select Variant> change with processing>Make repairs in foreign namespaces only if they are urgent> Continue(Enter)>again 'enter'>Object can only be created in SAP package>continue(enter)> Exit and save >This variant contains other screens, adopt these as well?>enter>enter> scroll down to the entry required by you make the necessary changes(Output only, invisible or required) and save.
    The system will prompt to assign a package and request enter the necessary values.
    Provide your feedback.
    Regards,
    PATHIK

  • How to create a package and add a file?

    Hi all,
    I am new to Java and very much much confussed with how to create a package and then include some files any help will be very thankfull.
    Thanks for your help
    kka.

    Steps for creating a package in java are as follows:
    Choose a base directory for your classes. For example, you might choose c:\java\packages. Type the following command:
    set CLASSPATH=%CLASSPATH%;c:\java\packages
    Create subdirectories for each chapter or section, if you don't already have them.
    For each of the classes in the subdirectories, add the following line to the very top of each file:
    package directory-name;
    where directory-name is the name of the subdirectory the class file is located in.
    In other directories you may have class files that need to access one of the classes in another directory (package). To do this, write one of the following at the top of the class that needs the other class:
    import subdir.*;
    or
    import subdir.classname;
    Use the class by name in the new class file.
    Note that you can create sub-packages by creating subdirectories of the original subdirectories, and inserting package statements at the top of the java files in those directories.
    Hope this helps!

  • How to make the dblink and what is the use of this

    plz any body tell me "how to make the dblink and what is the use of this"
    sujit

    Do you understand how to make the Slider work using code to read its value?  You will need to look into that in order to do this.
    What you can do is have the yello rectangle be a movieclip that sits over the red rectangle and use the Slider to control the yellow rectangle's alpha property from 0 to 1.  That way the yellow will gradually fade as you slide.
    What you will then need  to do is figure out how to make the number of dots that appear reduce from 15 to 8 over the same range of the slider.  You need to use the fractional value from the slider to decide how many dots either appear or do not appear.
    You should not start new postings for the same topics that you arlready have postings for.  Doing so in the future might result in them being removed.

  • How to make New Document and Upload Document to have same Content Type in Document Library in Sharepoint 2010

    Hi,
    How to make 'New Document' and 'Upload Document' to have same content type(Custom) in Document Library in Sharepoint2010.
    Note : I have created custom Content Type since I have custom columns along with upload column..
    Regards, Shreyas R S

    go to library settings 
    Change new button order and default content type
    set your custom content type to be #1
    when you upload new document it will automatically have your custom content type
    Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010

  • How to make your iPad and iPhone commicate with each other

    How to make your iPad and iPhone commicate with each other

    this is very easy...
    firstly disconnect the DSL modem for the linksys..
    then connect the computer to the linksys router (port 1/2/3/4)..
    then access the linksys setup UI
    open ur web browser
    site: http://192.198.1.1/
    username: [blank]
    password: admin
    now hook up the westell modem.. and goto the status page ...
    check Internet IP.
    if then Internet IP is 192.168.1.* then,
    disconnect the westell from the router and goto the setup page.
    change the LOCAL IP address to 192.168.2.1 (notice the 2.1 and not 1.1)
    save settings....
    connect the westell and viola ur online...
    if the Internet IP is 0.0.0.0 then
    goto the setup page and change the 'Internet connection Type' to 'PPPoE'
    once done the page changes and give u a place to enter a username and a password.. this username and password is given by verizon..
    sud be something like '[email protected]'
    once done save settings...
    goto the status page and hit connect... give it a few moments... u shud get a Internet ip address... if u get one ur online if not then power cycle the entire network. and try check to see if u get an ip..
    hope this helps...
    cheers..
    Life is short... So get movin !!!
    DopeLorD

  • Keyword package and import

    helo,
    someone, pls tell me the difference between using package and import? wat are the difference things that they include in our source file?
    in simple terms pls.
    thanks

    http://java.sun.com/docs/books/tutorial/java/interpack/packages.html

  • How to make own editor and call it?

    could you please tell me how to make own editor and call it on a clicking of a push button corresponding to an test Item

    In the Object Navigator... just click on the 'Editor' Node and press the '+' (Create) button....
    Set then any properties as you like....
    So simple...
    Greetings,
    Sim

  • Package and import

    I have a problem about the syntax package and import . If i create a class file that call "Play.java" and keep it at directory call "test".
    Now , i create the main file that call the "Play" class and this current file keep at directory that call "demo". That is mean the "demo" directory includes the main file and "test" subdirectory. So , what should i do ?
    Thanks.

    I would assume that you have two files and want one of them to belong to a package. If the main directory you are working out of is c:\demo\ (/demo/ on a *nix system) you would have the following in that directory.
    c:\demo\MainProgramClass.java
    c:\demo\test\
    The c:\demo\test subdirectory would then contain a class called Play.java (c:\demo\test\Play.java)
    Right?
    That means the Play.java class belongs to the package 'test', so you would include the following at the start of the Play.java file:
    package test;
    Your MainProgramClass.java file (or whatever you named it) should contain the following import statement:
    import test.*;
    This will import all of the files in the test package (basically everything in the test directory). You could also use 'import test.Play;' if you only want to import the Play class.
    Hope this is what you wanted,
    Ryan

  • How to make an ebook and sell it on the ibook or app store??

    How to make an ebook and sell it on the ibook or app store??
    Can anybody help me please T^T
    By the way I'm in Thailand and want to sell my ebook around the world.
    This is my dream ^^.. Help me please...

    Hi,
    Start with the ADC iOS dev center here.
    http://developer.apple.com/devcenter/ios/index.action
    Carolyn

  • How to make an before and after effects?

    So, I want to make a video that show the audience this is before and after the edit. And i want to make it look like this YouTube Rewind 2014: Behind the Scenes - YouTube
    How to make it?
    Thanks:)

    Really? You take footage of you shooting the video with another camera then you edit it together with shots of the finished project. If you want to show before and after shots of an effect you just put the original footage on top and animate a mask or opacity to reveal the rendered effect below.
    If you can't figure out how to make a before and after then you will have a very difficult time doing any effects using AE because there is absolutely nothing in this before and after but very basic editing and masking.

  • HT1420 How to make Apple ID and iCloud the same Id?

    How to make Apple ID and iCloud ID the same after they have been created?
    iTunes keeps asking for ID and passwords that were created differently.

    You can't im afraid. I wanted to do the same and got the following from Apple:
    I am sorry, you cannot update your email address to MobileMe address as each Apple ID is unique.
    Ross, I would like to let you know that, you cannot change your Apple ID if it was at any time a .Mac or MobileMe email address, even if your subscription has ended or been canceled.
    The email address that ends in .me is already an Apple ID as well, as when you set up a MobileMe email its automatically set up as an Apple ID. So you cannot use this email address on another account. It is permanently associated with your MobileMe Apple ID.
    This article provides helpful information when choosing which Apple ID to use with iCloud:
    Apple IDs and iCloud
    http://support.apple.com/kb/HT4895
    This page also covers topics such as moving MobileMe accounts to iCloud, managing your Apple ID, and how to get content purchased with multiple Apple IDs onto your iOS device.
    I hope this information was helpful. If you require further assistance, please do not hesitate to reply to this email and I will be more than happy to assist you further.
    Sincerely,
    Thenmozhi
    iTunes Store Customer Support
    http://www.apple.com/support/itunes/ww/
    I wrote back and tried to escialte the issue but got no where. The whole thing is very disappointing and I hope Apple sort it out eventually.

  • Hello, i would like to know how to make horizontal sites and it moves with the scroll

    Hello, i would like to know how to make horizontal sites and it moves with the scroll

    Hi
    You can refer to these videos :
    http://www.lynda.com/Muse-tutorials/basics-horizontal-scrolling-websites/108131/115685-4.h tml
    https://www.youtube.com/watch?v=gZI_K1TXqOM
    Thanks,
    Sanjit

Maybe you are looking for

  • I want to resell Oracle Database Cloud Service. What are the criteria to do so?

    In order to resell Oracle Database Cloud Service, partners need to meet the following criteria: Be a Gold, Platinum, or Diamond member of the Oracle PartnerNetwork in good standing with a valid OPN Agreement. Have a valid Full Use Program Distributio

  • How do I change my plan from out of the country?

    On August 27 I called to cancel my Verizon service because I was moving to Australia. I was told that rather than take the full cancellation fee they could move me to this $15/mo plan and I could just pay that each month until my contract ran out on

  • Contractors to perform operation in house

    We want to hire external workers to assembler our product in our factory, we raise a external procure Purchase  Requisition (PR) from the production order operation with control key PP02 (external proc), a PR is generated from  the production order .

  • Power supply spark...fried mobo?

    Hey my frieed with a K8N Neo is having a problem..everything was working fine in his pc for 11 months...one day his powersupply sparked and the computer would not boot. No lights, no fans, nothing. So he set in a replacement for a power supply and re

  • I've got an email notification, but I have no email?

    I can't find the email. I've searched my inbox for unopened emails. I don't have it set to hide filed emails. I've reset the time and date. I've reconciled a thousand times, and even though there isn't an email in my actual inbox (checking through my