adding a new library .jar to your path (netbeans)

Discussion in 'Java' started by jason, May 15, 2010.

  1. jason

    jason Guest

    hello!

    just downloaded swing worker.

    i up until now have not needed any external libraries for any of my
    projects.

    how do i go about adding this? if this is very dumb and is easily
    solved with a link, please let me know. if i could find it by googling
    i think i would have already as i tried for a bit.

    thanks!
     
    jason, May 15, 2010
    #1
    1. Advertising

  2. In article
    <>,
    jason <> wrote:

    > just downloaded swing worker.
    >
    > i up until now have not needed any external libraries for any of my
    > projects.
    >
    > how do i go about adding this?


    Adding this to what? What JVM version are you targeting? What build
    environment are you using? Have you tried this?

    <http://groups.google.com/group/comp.lang.java.programmer/msg/9b707988630265cd>

    > if i could find it by googling i think i would have already as
    > i tried for a bit.


    You should still try. Without knowing what you found or tried, it's
    hard to suggest a way forward. For Java 5, download
    swing-worker-src-1.2.zip from <https://swingworker.dev.java.net/>.

    $ unzip swing-worker-src-1.2.zip
    Archive: swing-worker-src-1.2.zip
    creating: ...

    Then run the demo outlined in the SwingWorker API:

    <http://java.sun.com/javase/6/docs/api/javax/swing/SwingWorker.html>

    $ ant demo
    Buildfile: build.xml

    init:
    [mkdir] Created dir: ...

    compile:
    [javac] Compiling 3 source files to ...

    demo:
    [javac] Compiling 1 source file to ...

    BUILD SUCCESSFUL
    Total time: 10 seconds

    Use ` ant -p` to see other build targets.

    SwingWorker is included in Java 6 and later.

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, May 15, 2010
    #2
    1. Advertising

  3. jason

    markspace Guest

    jason wrote:

    > just downloaded swing worker.


    > how do i go about adding this? if this is very dumb and is easily
    > solved with a link, please let me know. if i could find it by googling
    > i think i would have already as i tried for a bit.



    This is a little on the dumb side. Do you know what the Java API is?
    It's the stuff that comes with both the JRE (runtime) and the JDK
    (development kit). If you see it in Sun's basic documentation, then you
    already have it.

    Therefore, exactly what problem are you having? As always please
    provide an SSCCE.
     
    markspace, May 15, 2010
    #3
  4. jason

    jason Guest

    On May 15, 12:07 pm, markspace <> wrote:
    > jason wrote:
    > > just downloaded swing worker.
    > > how do i go about adding this? if this is very dumb and is easily
    > > solved with a link, please let me know. if i could find it by googling
    > > i think i would have already as i tried for a bit.

    >
    > This is a little on the dumb side.  Do you know what the Java API is?
    > It's the stuff that comes with both the JRE (runtime) and the JDK
    > (development kit).  If you see it in Sun's basic documentation, then you
    > already have it.
    >
    > Therefore, exactly what problem are you having?  As always please
    > provide an SSCCE.


    okay, to answer all of your questions at once:

    i am trying to run this code exactly:
    http://java.sun.com/docs/books/tuto...y/FlipperProject/src/concurrency/Flipper.java

    when i run it using the launch button here:
    http://java.sun.com/docs/books/tutorial/uiswing/concurrency/interim.html

    it runs perfectly.

    when i bring it into net beans (i am running verison 6.8:
    http://netbeans.org/downloads/index.html i am using the bundle with
    all possible technologies). i am running Java JDK 1.5

    now, when i download and unzip this file it is all present in my
    download file (running on a mac).
    if i bring this code into my netbeans developer i get the following
    error:
    import javax.swing.SwingWorker; //line with error

    error:
    cannot find symbol
    symbol: class swing worker
    location: package javax.swing

    i am assuming this is because my netbeans is not acknowledging the
    file. and i agree, i haven't bridged this in any way.

    i agree it is obvious i am not too sure what i am talking about. i am
    honestly trying here, and if there is anything i can do to help you
    help me try and be patient.

    thanks in advance.
     
    jason, May 15, 2010
    #4
  5. jason

    markspace Guest

    jason wrote:
    > i am running Java JDK 1.5


    The SwingWorker documentation says:

    Since:
    1.6

    Download the latest JDK and add it to the NetBeans platform. Then
    change your project properties to use Java 1.6.
     
    markspace, May 15, 2010
    #5
  6. jason

    jason Guest

    >when i bring it into net beans (i am running verison 6.8:
    >http://netbeans.org/downloads/index.html i am using the bundle with
    >all possible technologies). i am running Java JDK 1.5
    >now, when i download and unzip this file it is all present in my
    >download file (running on a mac).



    let me clarify in advance. i bring the flipper code into netbeans. a
    project i created called flipper.

    i have downloaded the zip for swingworker and it is in my downloads
    file.

    the flipper file is the code open noted above that is giving the erorr.
     
    jason, May 15, 2010
    #6
  7. jason

    Lew Guest

    jason wrote:
    > when i [sic] bring it into net beans [sic] (i [sic] am running verison 6.8:
    > http://netbeans.org/downloads/index.html i [sic] am using the bundle with
    > all possible technologies). i [sic] am running Java JDK 1.5


    Java 5 hit "end-of-life", that is, was officially retired by Sun on April 8,
    2008, over two years ago. Java 6, the current version, was released to the
    public on December 11, 2006, well over three years ago. Is there a particular
    reason that you cannot use the current version of Java?

    'SwingWorker' has been included with the current Java version for over three
    years.
    <http://java.sun.com/javase/6/webnotes/features.html>

    Whether you use Java 5 or 6, be quite sure to keep up to date with the minor
    version, that is, the number after the underscore in "Java 1.6.0_20" or
    "1.5.0_22". As in the case of these very latest versions, there are important
    security fixes and bug fixes in the minor upgrades.

    --
    Lew
     
    Lew, May 16, 2010
    #7
  8. In article
    <>,
    jason <> wrote:

    > when i bring it into net beans (i am running verison 6.8:
    > http://netbeans.org/downloads/index.html i am using the bundle with
    > all possible technologies). i am running Java JDK 1.5


    Download swing-worker-1.2.jar from <https://swingworker.dev.java.net/>.
    Right click on your Projects > Libraries > Add JAR/Folder, and add the
    JAR to the project.

    On Mac OS X 10.5 and later, you can add Java 1.6 under Tools > Java
    Platforms, if it's not already present.

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, May 16, 2010
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    631
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,790
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,868
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    700
    Arnold Peters
    Jan 5, 2005
  5. markspace
    Replies:
    2
    Views:
    496
    markspace
    Oct 7, 2011
Loading...

Share This Page