placement of other jars not in original in JDK download

B

bH

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
 
J

Jeff Higgins

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.
 
L

Lew

Jeff said:

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.
 
R

Roedy Green

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
 
J

Jeff Higgins

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.
 
J

John B. Matthews

Arne Vajhøj said:
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.
 
B

Bob H

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
 
L

Lew

Bob said:
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 :

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.
 
B

Bob H

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
 
D

Daniele Futtorovic

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...
 
J

Jeff Higgins

Perhaps you should consider whether all this computer stuff is really
something for you...
bH has been posting to c.l.j... for years.
It's either a long running troll or ...
 
B

Bob H

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");
}
}
 
J

John B. Matthews

Bob H said:
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
 
G

Gunter Herrmann

Hi!

Roedy said:
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
 
A

Arne Vajhøj

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
 
A

Arne Vajhøj

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
 
A

Arne Vajhøj

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
 
B

Bob H

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,783
Latest member
RickeyDort

Latest Threads

Top