Results 1 to 5 of 5
  1. #1
    JDCAce's Avatar
    JDCAce is offline Member
    Join Date
    Oct 2008
    Location
    Columbus, GA, US
    Posts
    29
    Rep Power
    0

    Default Making A Set Of Classes "Importable"

    My class uses a set of classes written by guys at Georgia Tech; these classes are, for instance, used for pictures, sounds, and even one for a little turtle you can "drive" around the window to make him draw something.

    Now, I'm not sure if these classes are copyrighted or not (I can check that later), but I would like to make these classes available to all programs I want, not just programs placed in a specific folder. How would I do this? Would I add an import statement at the beginning? What would I tell the program to import, the files' directory? Would I need to alter the classes I want to import to make them importable?

    If you don't want to explain the process, then at least tell me what this process is called. I've heard the term generalization (but I don't know what it is); is what I want to do called generalization?
    "Things are made of littler things that jiggle."

  2. #2
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Red face classpath

    This is what classpath is all about. There is also a folder called extensions where tools like this can be found, but they are not included in the build and have to be included somehow if the tool is to be used in distribution:
    Java Code:
    C:\Program Files\Java\jdk1.6.0\jre\lib\ext\sunjce_provider.jar
    for example allows me to do testing and learning on a jar file from Sun.

    I still do not know how to use classpath correctly, I gave up on it - somehow there should be a way to place third party libs in distributions....

    some little place to put them....
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,423
    Rep Power
    20

    Default

    No, it's not generalization, and I haven't heard that term used in the context of Java... are you sure you don't mean 'Generics'?

    As Nicholas has said, you need to learn about setting the classpath. If you're using any IDE (Eclipse? NetBeans?) there is a setting for the compile time and run time classpath.

    Never used Eclipse myself, but NetBeans builds a lib folder in the dist folder and creates a ReadMe.txt file with adequate instructions for deploying the application.

    Here's a link that will give you plenty of tutorial matter to read through, all of it useful even if not directly applicable to your present problem.
    Sun Microsystems - Search

    db

  4. #4
    JDCAce's Avatar
    JDCAce is offline Member
    Join Date
    Oct 2008
    Location
    Columbus, GA, US
    Posts
    29
    Rep Power
    0

    Default

    Ah, thanks, you two. Yes, the term was generics, and I learned what that meant yesterday. I shall now learn about classpaths!
    "Things are made of littler things that jiggle."

  5. #5
    Nicholas Jordan's Avatar
    Nicholas Jordan is offline Senior Member
    Join Date
    Jun 2008
    Location
    Southwest
    Posts
    1,018
    Rep Power
    8

    Default

    Runs a little different depending on what OS you are using. If it is one of the Unice ( eg Linux or System5 ) then env_vars or something is an array of name=value pairs the each '~' can have in some '/'

    For winnie, we may set the ${CLASSPATH} in Control Panel / ( sorry but I try to avoid backslashing ) / System / Envionment Variables

    Better (IMO) to use command line syntax to spec classpath for each invocation of either compiler or jvm, gets sorta messy trying to disentangle all the places to put things. Java will map between '.' and a directory in a remarkably eager fashion. I saw something on a very advanced site where some folks do not use classpath due to unpredictable nature of parsing on differing platforms.

    I will write a hundred line program to demonstrate some simple concept for an intermediate, but do not use package statments in my own code due to the convoluted nature of getting things located.

    If you use NetBeans, it will figure it out for you.
    Introduction to Programming Using Java.
    Cybercartography: A new theoretical construct proposed by D.R. Fraser Taylor

Similar Threads

  1. Hwlp with "Open", "Save", "Save as..."
    By trill in forum New To Java
    Replies: 3
    Last Post: 11-02-2010, 09:26 AM
  2. Java, Military Format using "/" and "%" Operator!!
    By sk8rsam77 in forum New To Java
    Replies: 11
    Last Post: 02-26-2010, 03:03 AM
  3. Replies: 1
    Last Post: 10-20-2008, 07:35 AM
  4. <core:forEach var="" begin="+<%=j%>+">???
    By freddieMaize in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 09-27-2008, 01:20 AM
  5. "Jumble" or "Scramble" Program
    By Shadow22202 in forum Java Applets
    Replies: 8
    Last Post: 04-30-2008, 03:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •