placement of other jars not in original in JDK download

Discussion in 'Java' started by bH, Aug 21, 2012.

  1. bH

    bH Guest

    Hi All,
    If I download poi-3.8 binary and I want to access
    some of the jar files that are in the download,
    as in this set of opening lines of a program that
    uses some of it:

    import org.apache.poi.poifs.filesystem.*;
    import org.apache.poi.hwpf.*;
    import org.apache.poi.hwpf.extractor.*;
    import java.io.*;

    Where do I place the poi-3.8
    items(jars) that are in apache poi download?
    my compiler is:

    JDK 6.0_25 from C:\Program Files\Java\jdk1.6.0_25\lib\tools.jar

    TIA,
    bH
    bH, Aug 21, 2012
    #1
    1. Advertising

  2. bH

    Jeff Higgins Guest

    On 08/21/2012 03:31 PM, bH wrote:
    > Hi All,
    > If I download poi-3.8 binary and I want to access
    > some of the jar files that are in the download,
    > as in this set of opening lines of a program that
    > uses some of it:
    >
    > import org.apache.poi.poifs.filesystem.*;
    > import org.apache.poi.hwpf.*;
    > import org.apache.poi.hwpf.extractor.*;
    > import java.io.*;
    >
    > Where do I place the poi-3.8
    > items(jars) that are in apache poi download?


    On the classpath.
    <http://docs.oracle.com/javase/tutorial/essential/environment/paths.html>

    > my compiler is:
    >
    > JDK 6.0_25 from C:\Program Files\Java\jdk1.6.0_25\lib\tools.jar
    Jeff Higgins, Aug 21, 2012
    #2
    1. Advertising

  3. bH

    Lew Guest

    Jeff Higgins wrote:
    > bH wrote:
    > > If I download poi-3.8 binary and I want to access
    > > some of the jar files that are in the download,
    > > as in this set of opening lines of a program that
    > > uses some of it:

    >
    > > import org.apache.poi.poifs.filesystem.*;
    > > import org.apache.poi.hwpf.*;
    > > import org.apache.poi.hwpf.extractor.*;
    > > import java.io.*;

    >
    > > Where do I place the poi-3.8
    > > items(jars) that are in apache poi download?

    >
    > On the classpath.
    > <http://docs.oracle.com/javase/tutorial/essential/environment/paths.html>


    Except don't use the CLASSPATH environment variable.

    Use the "-cp" or equivalent "-classpath" option to the Java tools.
    <http://docs.oracle.com/javase/7/docs/index.html>
    <http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/java.html#options>

    <http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/classpath.html>
    "path option is preferred because you can set it individually for each application
    without affecting other applications and without other applications modifying its value."

    In short, OP, read the documentation.

    --
    Lew
    Lew, Aug 21, 2012
    #3
  4. bH

    Roedy Green Guest

    On Tue, 21 Aug 2012 12:31:40 -0700 (PDT), bH <>
    wrote, quoted or indirectly quoted someone who said :

    >JDK 6.0_25 from C:\Program Files\Java\jdk1.6.0_25\lib\tools.jar


    put them in the ext dir
    put them on the SET classpath
    put them on the commandline -classpath
    use JNLP
    --
    Roedy Green Canadian Mind Products http://mindprod.com
    A new scientific truth does not triumph by convincing its opponents and making them see the light,
    but rather because its opponents eventually die, and a new generation grows up that is familiar with it.
    ~ Max Planck 1858-04-23 1947-10-04
    Roedy Green, Aug 21, 2012
    #4
  5. bH

    Jeff Higgins Guest

    On 08/21/2012 04:50 PM, Lew wrote:
    > Jeff Higgins wrote:
    >> bH wrote:
    >>> If I download poi-3.8 binary and I want to access
    >>> some of the jar files that are in the download,
    >>> as in this set of opening lines of a program that
    >>> uses some of it:

    >>
    >>> import org.apache.poi.poifs.filesystem.*;
    >>> import org.apache.poi.hwpf.*;
    >>> import org.apache.poi.hwpf.extractor.*;
    >>> import java.io.*;

    >>
    >>> Where do I place the poi-3.8
    >>> items(jars) that are in apache poi download?

    >>
    >> On the classpath.
    >> <http://docs.oracle.com/javase/tutorial/essential/environment/paths.html>

    >
    > Except don't use the CLASSPATH environment variable.
    >
    > Use the "-cp" or equivalent "-classpath" option to the Java tools.
    > <http://docs.oracle.com/javase/7/docs/index.html>
    > <http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/java.html#options>
    >
    > <http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/classpath.html>
    > "path option is preferred because you can set it individually for each application
    > without affecting other applications and without other applications modifying its value."
    >
    > In short, OP, read the documentation.
    >

    Thank you for reiterating the advice given in the tutorial link above.
    Jeff Higgins, Aug 21, 2012
    #5
  6. bH

    Arne Vajhøj Guest

    On 8/21/2012 5:11 PM, Roedy Green wrote:
    > On Tue, 21 Aug 2012 12:31:40 -0700 (PDT), bH <>
    > wrote, quoted or indirectly quoted someone who said :
    >
    >> JDK 6.0_25 from C:\Program Files\Java\jdk1.6.0_25\lib\tools.jar

    >
    > put them in the ext dir
    > put them on the SET classpath
    > put them on the commandline -classpath
    > use JNLP


    2 bad + 2 good advices

    Arne
    Arne Vajhøj, Aug 22, 2012
    #6
  7. In article <50341328$0$291$>,
    Arne Vajhøj <> wrote:

    > On 8/21/2012 5:11 PM, Roedy Green wrote:
    > > On Tue, 21 Aug 2012 12:31:40 -0700 (PDT), bH <>
    > > wrote, quoted or indirectly quoted someone who said :
    > >
    > >> JDK 6.0_25 from C:\Program Files\Java\jdk1.6.0_25\lib\tools.jar

    > >
    > > put them in the ext dir
    > > put them on the SET classpath
    > > put them on the commandline -classpath
    > > use JNLP

    >
    > 2 bad + 2 good advices


    bH: You may not notice problems from the first two until you've parked a
    few JARs there, forgotten about them, and then added newer versions
    elsewhere.

    If you're using NetBeans, add the JARs in Tools > Libraries, where they
    can then be accessed as a group by projects that need them. Eclipse has
    a comparable feature.

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
    John B. Matthews, Aug 22, 2012
    #7
  8. bH

    Lew Guest

    Jeff Higgins wrote:
    > Lew wrote:
    >> Jeff Higgins wrote:
    >>> bH wrote:
    >>>> If I download poi-3.8 binary and I want to access
    >>>> some of the jar files that are in the download,
    >>>> as in this set of opening lines of a program that
    >>>> uses some of it:
    >>>
    >>>> import org.apache.poi.poifs.filesystem.*;
    >>>> import org.apache.poi.hwpf.*;
    >>>> import org.apache.poi.hwpf.extractor.*;
    >>>> import java.io.*;
    >>>
    >>>> Where do I place the poi-3.8
    >>>> items(jars) that are in apache poi download?
    >>>
    >>> On the classpath.
    >>> <http://docs.oracle.com/javase/tutorial/essential/environment/paths.html>

    >>
    >> Except don't use the CLASSPATH environment variable.
    >>
    >> Use the "-cp" or equivalent "-classpath" option to the Java tools.
    >> <http://docs.oracle.com/javase/7/docs/index.html>
    >> <http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/java.html#options>
    >>
    >>
    >> <http://docs.oracle.com/javase/6/docs/technotes/tools/solaris/classpath.html>
    >> "path option is preferred because you can set it individually for each
    >> application
    >> without affecting other applications and without other applications
    >> modifying its value."
    >>
    >> In short, OP, read the documentation.
    >>

    > Thank you for reiterating the advice given in the tutorial link above.


    You are very welcome.

    --
    Lew
    Honi soit qui mal y pense.
    http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg
    Lew, Aug 22, 2012
    #8
  9. bH

    Bob H Guest

    Hi All,
    Clarifying what I ultimately wanted:
    I am trying to read a "xxx.doc" file downloaded
    to a Windows Vista 32-bit operating system.
    John M wrote :
    "If you're using NetBeans, add the JARs in Tools > Libraries, where they
    can then be accessed as a group by projects that need them. Eclipse has
    a comparable feature."

    I am using neither NetBeans nor Eclipse.

    The posts here so far indicate that I should place
    latest poi-3.8 binary jars into the folder where
    where the tools.jar is located?

    If there is no more help forthcoming then I abandon
    this project.

    Thanks to all for your responses.

    bH
    Bob H, Aug 22, 2012
    #9
  10. bH

    Lew Guest

    Bob H wrote:
    > Clarifying what I ultimately wanted:
    > I am trying to read a "xxx.doc" file downloaded
    > to a Windows Vista 32-bit operating system.
    >
    > John M wrote :
    >> "If you're using NetBeans, add the JARs in Tools > Libraries, where they
    >> can then be accessed as a group by projects that need them. Eclipse has
    >> a comparable feature."

    >
    > I am using neither NetBeans nor Eclipse.
    >
    > The posts here so far indicate that I should place
    > latest poi-3.8 binary jars into the folder where
    > where the tools.jar is located?


    NO!

    No, no, no.

    Put it anywhere you want and include the JAR in the classpath.

    > If there is no more help forthcoming then I abandon
    > this project.


    What was wrong with the complete and accurate help you already got?

    Did you read the indicated links about classpath?

    Why not?

    > Thanks to all for your responses.


    You thank us best by using the information. Jeff Higgins, for example,
    gave you a very solid start.

    --
    Lew
    Lew, Aug 22, 2012
    #10
  11. bH

    Bob H Guest

    On Tuesday, August 21, 2012 3:31:40 PM UTC-4, Bob H wrote:
    > Hi All,
    >
    > If I download poi-3.8 binary and I want to access
    >
    > some of the jar files that are in the download,
    >
    > as in this set of opening lines of a program that
    >
    > uses some of it:
    >
    >
    >
    > import org.apache.poi.poifs.filesystem.*;
    >
    > import org.apache.poi.hwpf.*;
    >
    > import org.apache.poi.hwpf.extractor.*;
    >
    > import java.io.*;
    >
    >
    >
    > Where do I place the poi-3.8
    >
    > items(jars) that are in apache poi download?
    >
    > my compiler is:
    >
    >
    >
    > JDK 6.0_25 from C:\Program Files\Java\jdk1.6.0_25\lib\tools.jar
    >
    >
    >
    > TIA,
    >
    > bH


    Hi Lew,
    Thanks for responding. I looked at Jeff's
    help. I have a problem with Oracle's
    directions. The directions from them give me a case
    of the jitters resetting things that I was
    not responsible for initially in the setup:
    (administrator).

    < http://docs.oracle.com/javase/tutorial/essential/environment/paths.html >
    I find there:
    "C:\Java\jdk1.7.0\bin\javac MyClass.java"
    This I understand!
    I also find there for"Windows 7",
    which I have :
    1.From the desktop, right click the Computer icon.
    2.Choose Properties from the context menu.
    3.Click the Advanced system settings link.
    4.Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
    5.In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.

    --------------------------------------------------------------------------------
    Note: You may see a PATH environment variable similar to the following whenediting it from the Control Panel:
    %JAVA_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
    Variables enclosed in percentage signs (%) are existing environment variables. If one of these variables is listed in the Environment Variables windowfrom the Control Panel (such as JAVA_HOME), then you can edit its value. If it does not appear, then it is a special environment variable that the operating system has defined. For example, SystemRoot is the location of the Microsoft Windows system folder. To obtain the value of a environment variable, enter the following at a command prompt. (This example obtains the value of the SystemRoot environment variable):
    echo %SystemRoot%"

    Lew,
    there is the information from Roedy,
    and the following post from Arne:

    "2 bad + 2 good advices"
    Arne

    My response to that is :
    What am I supposed to think and do with that information?

    Lew,
    You wrote:
    "NO! No, no, no
    Put it anywhere you want and include the JAR in the classpath.

    My response to that is :
    I tried all combinations of "poi-bin-3.8-20120326 jars"
    where and what to put there.

    I am frustrated: I need a cookie
    sized tranquilizer.

    Buen día y gracias.

    bH
    Bob H, Aug 23, 2012
    #11
  12. On 23/08/2012 01:49, Bob H allegedly wrote:
    > My response to that is :
    > I tried all combinations of "poi-bin-3.8-20120326 jars"
    > where and what to put there.
    >
    > I am frustrated: I need a cookie
    > sized tranquilizer.


    Perhaps you should consider whether all this computer stuff is really
    something for you...

    > mkdir C:\MyArse
    > copy poi.jar C:\MyArse\
    > java -cp C:\MyArse\poi.jar MyClass


    --
    DF.
    Daniele Futtorovic, Aug 23, 2012
    #12
  13. bH

    Jeff Higgins Guest

    On 08/22/2012 08:39 PM, Daniele Futtorovic wrote:
    > On 23/08/2012 01:49, Bob H allegedly wrote:
    >> My response to that is :
    >> I tried all combinations of "poi-bin-3.8-20120326 jars"
    >> where and what to put there.
    >>
    >> I am frustrated: I need a cookie
    >> sized tranquilizer.

    >
    > Perhaps you should consider whether all this computer stuff is really
    > something for you...
    >
    >> mkdir C:\MyArse
    >> copy poi.jar C:\MyArse\
    >> java -cp C:\MyArse\poi.jar MyClass

    >

    bH has been posting to c.l.j... for years.
    It's either a long running troll or ...
    Jeff Higgins, Aug 23, 2012
    #13
  14. bH

    Bob H Guest

    On Wednesday, August 22, 2012 8:49:30 PM UTC-4, Jeff Higgins wrote:
    > On 08/22/2012 08:39 PM, Daniele Futtorovic wrote:
    >
    > > On 23/08/2012 01:49, Bob H allegedly wrote:

    >
    > >> My response to that is :

    >
    > >> I tried all combinations of "poi-bin-3.8-20120326 jars"

    >
    > >> where and what to put there.

    >
    > >>

    >
    > >> I am frustrated: I need a cookie

    >
    > >> sized tranquilizer.

    >
    > >

    >
    > > Perhaps you should consider whether all this computer stuff is really

    >
    > > something for you...

    >
    > >

    >
    > >> mkdir C:\MyArse

    >
    > >> copy poi.jar C:\MyArse\

    >
    > >> java -cp C:\MyArse\poi.jar MyClass

    >
    > >

    >
    > bH has been posting to c.l.j... for years.
    >
    > It's either a long running troll or ...


    Hi Jeff,
    Thanks for the consideration you wrote.
    Sometimes the help here is outstanding,
    other times I don't understand what is
    being said. So it requires
    me to "solve my problem" in a different manner.

    While searching the internet most recently,
    I came across this solution which does the
    task of opening a 'xxx.doc'.
    So I am now using this Rutime model:


    //http://www.2shared.com/complete/x_C073Q-/WINWORD.html

    import java.io.*;

    public class RuntimeGetDoc
    {
    public static void main(String[] str)throws IOException
    {
    Runtime rt = Runtime.getRuntime();
    Process p = rt.exec("C:/Program Files/WinWord/WINWORD.exe");
    }
    }
    Bob H, Aug 23, 2012
    #14
  15. In article <>,
    Bob H <> wrote:

    > Hi All,
    > Clarifying what I ultimately wanted:
    > I am trying to read a "xxx.doc" file downloaded
    > to a Windows Vista 32-bit operating system.
    > John M wrote :
    > "If you're using NetBeans, add the JARs in Tools > Libraries, where
    > they can then be accessed as a group by projects that need them.
    > Eclipse has a comparable feature."
    >
    > I am using neither NetBeans nor Eclipse.


    How are you building, then? Command line? Ant? Another IDE?

    > The posts here so far indicate that I should place
    > latest poi-3.8 binary jars into the folder where
    > where the tools.jar is located?


    As Lew said, no. Put it where is makes sense for you. I keep poi
    with the only project I have that uses it, but I keep more widely
    used libraries in a place commonly used on my platform, /opt.

    Here's how I'd build and run MyReader from the command line:

    javac -d build/classes -cp poi-3.8/*:poi-3.8/lib/*:poi-3.8/ooxml-lib/* src/MyReader.java
    java -cp build/classes:poi-3.8/*:poi-3.8/lib/*:poi-3.8/ooxml-lib/* MyReader

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
    John B. Matthews, Aug 23, 2012
    #15
  16. Hi!

    Roedy Green wrote:
    > put them in the ext dir
    > put them on the SET classpath
    > put them on the commandline -classpath
    > use JNLP


    put the names of them into the manifest of your main jar
    (when using ant add a manifest section before creating the main jar)

    Example:

    <manifest>
    <attribute name="Main-Class" value="org.example.myapp.MyMainClass" />
    <attribute name="Class-Path" value=". log4j-1.2.17.jar ojdbc6.jar " />
    </manifest>

    call it with java -jar yourMainJar.jar

    Gunter
    Gunter Herrmann, Aug 23, 2012
    #16
  17. bH

    Arne Vajhøj Guest

    On 8/22/2012 7:49 PM, Bob H wrote:
    > Lew,
    > there is the information from Roedy,
    > and the following post from Arne:
    >
    > "2 bad + 2 good advices"
    > Arne
    >
    > My response to that is :
    > What am I supposed to think and do with that information?


    Pick one of the good advices instead of one of the bad!

    :)

    > Lew,
    > You wrote:
    > "NO! No, no, no
    > Put it anywhere you want and include the JAR in the classpath.
    >
    > My response to that is :
    > I tried all combinations of "poi-bin-3.8-20120326 jars"
    > where and what to put there.


    Store the jar in C:\javalibs\poi or something similar
    and use the -classpath switch to the Java command line
    to refer to it.

    Arne
    Arne Vajhøj, Aug 28, 2012
    #17
  18. On 8/21/2012 9:41 PM, John B. Matthews wrote:
    > In article <50341328$0$291$>,
    > Arne Vajhøj <> wrote:
    >
    >> On 8/21/2012 5:11 PM, Roedy Green wrote:
    >>> On Tue, 21 Aug 2012 12:31:40 -0700 (PDT), bH <>
    >>> wrote, quoted or indirectly quoted someone who said :
    >>>
    >>>> JDK 6.0_25 from C:\Program Files\Java\jdk1.6.0_25\lib\tools.jar
    >>>
    >>> put them in the ext dir
    >>> put them on the SET classpath
    >>> put them on the commandline -classpath
    >>> use JNLP

    >>
    >> 2 bad + 2 good advices

    >
    > bH: You may not notice problems from the first two until you've parked a
    > few JARs there, forgotten about them, and then added newer versions
    > elsewhere.


    Or get a new Java version.

    It is a very bad idea to mix ordinary library code with Java itself.

    The ext possibility exists for other reasons.

    Arne
    Arne Vajhøj, Aug 28, 2012
    #18
  19. bH

    Arne Vajhøj Guest

    On 8/22/2012 4:10 PM, Bob H wrote:
    > Clarifying what I ultimately wanted:
    > I am trying to read a "xxx.doc" file downloaded
    > to a Windows Vista 32-bit operating system.
    > John M wrote :
    > "If you're using NetBeans, add the JARs in Tools > Libraries, where they
    > can then be accessed as a group by projects that need them. Eclipse has
    > a comparable feature."
    >
    > I am using neither NetBeans nor Eclipse.
    >
    > The posts here so far indicate that I should place
    > latest poi-3.8 binary jars into the folder where
    > where the tools.jar is located?


    No.

    Most posts here indicate that you should put a ref to the
    jars in the Java command line.

    Arne
    Arne Vajhøj, Aug 28, 2012
    #19
  20. bH

    Bob H Guest

    On Monday, August 27, 2012 9:55:01 PM UTC-4, Arne Vajhøj wrote:
    > On 8/22/2012 4:10 PM, Bob H wrote:
    >
    > > Clarifying what I ultimately wanted:

    >
    > > I am trying to read a "xxx.doc" file downloaded

    >
    > > to a Windows Vista 32-bit operating system.

    >
    > > John M wrote :

    >
    > > "If you're using NetBeans, add the JARs in Tools > Libraries, where they

    >
    > > can then be accessed as a group by projects that need them. Eclipse has

    >
    > > a comparable feature."

    >
    > >

    >
    > > I am using neither NetBeans nor Eclipse.

    >
    > >

    >
    > > The posts here so far indicate that I should place

    >
    > > latest poi-3.8 binary jars into the folder where

    >
    > > where the tools.jar is located?

    >
    >
    >
    > No.
    >
    >
    >
    > Most posts here indicate that you should put a ref to the
    >
    > jars in the Java command line.
    >
    >
    >
    > Arne


    Hi All,
    Thanks to you all,for your help.
    I close with these remarks.

    Yes I was able to discover how
    to direct my IDE to the path of the .POI jar
    the respective jar containing the import.
    There is a "preferences" tab
    in the IDE which leads to a page
    to enter any path to individual .POI jars
    regardless of where it is.

    However in my sample
    program there were items for which
    that the .POI jar did not
    have some objects written in the
    sample. This sample program might have been written
    in an earlier time when publishing of the
    Apache .POI jar was not the same as
    the latest version for download now. The
    ..POI archive is available but at a
    sizable effort to discover which one it
    was. Even after that, the program
    might not access the version of Word
    that wrote the .doc that I want to read.

    So I close my quest with an observation of
    a search in comp.lang.java.programmer

    In a '07 post made by Raymond F Herrera
    "I need to convert MSWord ".doc" files to plain data ".rtf" ones"
    The OP writes in part:

    " > Roedy Green Canadian Mind Products
    > The Java Glossaryhttp://mindprod.com


    [Roedy's site says:]
    > .POI is not what I would call

    developer friendly. "

    I agree.

    bH
    Bob H, Aug 31, 2012
    #20
    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. Ike
    Replies:
    6
    Views:
    1,050
    Andrew Thompson
    Sep 24, 2004
  2. Replies:
    5
    Views:
    9,023
  3. JavaEnquirer
    Replies:
    2
    Views:
    513
    JavaEnquirer
    Feb 22, 2006
  4. Robert M. Gary
    Replies:
    2
    Views:
    284
    Andrew Thompson
    Dec 5, 2007
  5. Ulf Meinhardt
    Replies:
    2
    Views:
    1,401
Loading...

Share This Page