You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Jonathan Levi <dr...@aol.com> on 2015/11/03 03:25:35 UTC

Shell Can't Find pdfbox

I'm finding that shell commands to use pdfbox-app-1.8.10.jar won't work unless the full path is used. Example:

drj-air:Desktop jonathan$ ls /usr/local/bin/pdfb*
/usr/local/bin/pdfbox-app-1.8.10.jar
drj-air:Desktop jonathan$ java -jar pdfbox-app-1.8.10.jar ExtractText Contact-Office-Letter.pdf 
Error: Unable to access jarfile pdfbox-app-1.8.10.jar
drj-air:Desktop jonathan$ java -jar /usr/local/bin/pdfbox-app-1.8.10.jar ExtractText Contact-Office-Letter.pdf 
drj-air:Desktop jonathan$ 

Is there a shell variable that has to be set for Java to know where to look for jars?

Using Mac OS X 10.11.1.

TIA,

Jonathan

Re: Shell Can't Find pdfbox

Posted by Tres Finocchiaro <tr...@gmail.com>.
*most of us on the list * author such software

(Sorry, autocorrect put a bad word in there, my apologies).

Re: Shell Can't Find pdfbox

Posted by Jonathan Levi <dr...@aol.com>.
Thanks to all, I will put pdfbox in a separate directory and just have java open it using the full path (still don't understand why the -classpath option didn't work, although it's academic, since using it involves typing in the jar's full path and doesn't save time/space). I get your point about a .jar not being an executable; many thanks again.

jl

 

 

 

-----Original Message-----
From: Tres Finocchiaro <tr...@gmail.com>
To: users <us...@pdfbox.apache.org>
Sent: Sun, Nov 8, 2015 10:00 am
Subject: Re: Shell Can't Find pdfbox


If you are using PDFBOX as a standalone plugin, I would advise
against
installing this to "~/Library/Java/Extensions" and instead running it
from
absolute path as recommended by the wiki as well as the developers. 
(The
wiki may be vague about this, but "java -jar" is an example all
Java
projects use casually since it has been this way for a very long
time)

If you have a problem with the way a JAR file is executed on the
command
line, that should be taken up with Oracle or OpenJDK.  From where
I'm
standing, the documentation is correct and I see no evidence to
illustrate
"/usr/local/bin/" was ever suggested anywhere by anyone.

The
easiest way to comprehend how JARs are run is to treat them as a
document that
needs to be opened (since they are zip files).  Don't treat
then as an
application from a POSIX perspective, it will only confuse you.
Don't think
they are an executable command -- they are not.

In regards to WHERE to put
this, I'd like to reiterate that the part about
"~/Library/Java/Extensions" is
misleading for a few reasons.... Main one
being -- if you aren't using PDBOX in
any other Java applications you
should be careful not to expose it as an
extension to your computer (in
this case to the current user), because if you
use other Java software
which calls upon PDFBOX (most of us on the list hell
author such software),
you may find yourself using one different than what was
intended by the
developer.  i.e. make a directory YOU maintain and keep it
there. :)

So, put it in a safe place you maintain and that should cause the
least
amount of friction with other 3rd party programs.  That's my advice. :)

 

Re: Shell Can't Find pdfbox

Posted by Tres Finocchiaro <tr...@gmail.com>.
If you are using PDFBOX as a standalone plugin, I would advise against
installing this to "~/Library/Java/Extensions" and instead running it from
absolute path as recommended by the wiki as well as the developers.  (The
wiki may be vague about this, but "java -jar" is an example all Java
projects use casually since it has been this way for a very long time)

If you have a problem with the way a JAR file is executed on the command
line, that should be taken up with Oracle or OpenJDK.  From where I'm
standing, the documentation is correct and I see no evidence to illustrate
"/usr/local/bin/" was ever suggested anywhere by anyone.

The easiest way to comprehend how JARs are run is to treat them as a
document that needs to be opened (since they are zip files).  Don't treat
then as an application from a POSIX perspective, it will only confuse you.
Don't think they are an executable command -- they are not.

In regards to WHERE to put this, I'd like to reiterate that the part about
"~/Library/Java/Extensions" is misleading for a few reasons.... Main one
being -- if you aren't using PDBOX in any other Java applications you
should be careful not to expose it as an extension to your computer (in
this case to the current user), because if you use other Java software
which calls upon PDFBOX (most of us on the list hell author such software),
you may find yourself using one different than what was intended by the
developer.  i.e. make a directory YOU maintain and keep it there. :)

So, put it in a safe place you maintain and that should cause the least
amount of friction with other 3rd party programs.  That's my advice. :)

Re: Shell Can't Find pdfbox

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
@Timan
> Am 08.11.2015 um 15:38 schrieb Tilman Hausherr <TH...@t-online.de>:
> 
> Am 08.11.2015 um 15:14 schrieb Jonathan Levi:
>> The documentation is at https://pdfbox.apache.org/1.8/commandline.html. All I see is the suggested command line format, i.e., for the Decrypt command:
>> 
>> usage: java -jar pdfbox-app-x.y.z.jar Decrypt [OPTIONS] <inputfile> [outputfile]
> 
> The parameter for "-jar" is a file. So if the file argument has no path, it will be taken from the local directory. Sorry, but you're kindof arguing about a non-issue. People download the jar file somewhere, and then they run it from that directory.
> 
> A .jar file is not an executable. It is a zipped file with is an input for the java interpreter / compiler.
> 
> 
> @Maruan: what's this?
> https://pdfbox.apache.org/1.8/commandline.html
> 
> 
>   PDFSplit ## {#pdfSplit}

an error I just now fixed

Maruan

> 
> 
> 
> Tilman
> 
>> 
>>  
>>  As for theStackoverflow article: I copied the pdfbox JAR into ~/Library/Java/Extensions, restarted the computer, and verified:
>> 
>> jonathan$ ls ~/Library/Java/Extensions
>> pdfbox-app-1.8.10.jar
>> 
>> I then attempted to run the pdfbox JAR using the -classpath option:
>> 
>> jonathan$ java -classpath ~/Library/Java/Extensions/pdfbox-app-1.8.10.jar \
>>> -jar pdfbox-app-1.8.10.jar ExtractText afile.pdf afile.txt; cat afile.txt
>> Error: Unable to access jarfile pdfbox-app-1.8.10.jar
>> cat: afile.txt: No such file or directory
>> 
>> Finally, I ran the pdfbox JAR using its full path:
>> 
>> jonathan$ java -jar ~/Library/Java/Extensions/pdfbox-app-1.8.10.jar \
>>> ExtractText afile.pdf afile.txt; cat afile.txt
>> (Text)
>> 
>> 
>>  
>> -----Original Message-----
>> From: Tres Finocchiaro <tr...@gmail.com>
>> To: users <us...@pdfbox.apache.org>
>> Sent: Sat, Nov 7, 2015 9:33 pm
>> Subject: Re: Shell Can't Find pdfbox
>> 
>> 
>>> [...] it appears to be a different method than what the Apache
>> PDFBox
>> documentation specifies
>> 
>> Can you please provide a link to the
>> incorrect documentation?
>> 
>> No Java I've used recommends putting JAR files in a
>> UNIX PATH search
>> location.  The only possible thing I can think of is a wrapper
>> script
>> someone created as a helper.
>> 
>> When I search the Internet for "pdfbox
>> /usr/local/bin/", the archive of
>> this email is the only documentation I can
>> find on the matter -- minus a
>> mention of a /usr/local/bin/pdfbox wrapper script
>> which I can't find the
>> source for (suspected brew/tap/macport type culprit, but
>> no hits).
>> 
>> When I look through the PDFBOX command line tutorial I can't find
>> mention
>> of /usr/local/bin either.
>> 
>> Here is a good stackoverflow article
>> discussing where to put JAR files in
>> general and in which scenarios you should
>> and shouldn't use the
>> classpath
>> suggestions:
>> 
>> http://stackoverflow.com/questions/12842063/where-to-install-jar-files-on-os-x-so-other-java-applications-will-find-them
>> 
>>  
>> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Shell Can't Find pdfbox

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 08.11.2015 um 15:14 schrieb Jonathan Levi:
> The documentation is at https://pdfbox.apache.org/1.8/commandline.html. All I see is the suggested command line format, i.e., for the Decrypt command:
>
> usage: java -jar pdfbox-app-x.y.z.jar Decrypt [OPTIONS] <inputfile> [outputfile]

The parameter for "-jar" is a file. So if the file argument has no path, 
it will be taken from the local directory. Sorry, but you're kindof 
arguing about a non-issue. People download the jar file somewhere, and 
then they run it from that directory.

A .jar file is not an executable. It is a zipped file with is an input 
for the java interpreter / compiler.


@Maruan: what's this?
https://pdfbox.apache.org/1.8/commandline.html


    PDFSplit ## {#pdfSplit}



Tilman

>
>   
>
>   As for theStackoverflow article: I copied the pdfbox JAR into ~/Library/Java/Extensions, restarted the computer, and verified:
>
> jonathan$ ls ~/Library/Java/Extensions
> pdfbox-app-1.8.10.jar
>
> I then attempted to run the pdfbox JAR using the -classpath option:
>
> jonathan$ java -classpath ~/Library/Java/Extensions/pdfbox-app-1.8.10.jar \
>> -jar pdfbox-app-1.8.10.jar ExtractText afile.pdf afile.txt; cat afile.txt
> Error: Unable to access jarfile pdfbox-app-1.8.10.jar
> cat: afile.txt: No such file or directory
>
> Finally, I ran the pdfbox JAR using its full path:
>
> jonathan$ java -jar ~/Library/Java/Extensions/pdfbox-app-1.8.10.jar \
>> ExtractText afile.pdf afile.txt; cat afile.txt
> (Text)
>
>
>   
>
> -----Original Message-----
> From: Tres Finocchiaro <tr...@gmail.com>
> To: users <us...@pdfbox.apache.org>
> Sent: Sat, Nov 7, 2015 9:33 pm
> Subject: Re: Shell Can't Find pdfbox
>
>
>> [...] it appears to be a different method than what the Apache
> PDFBox
> documentation specifies
>
> Can you please provide a link to the
> incorrect documentation?
>
> No Java I've used recommends putting JAR files in a
> UNIX PATH search
> location.  The only possible thing I can think of is a wrapper
> script
> someone created as a helper.
>
> When I search the Internet for "pdfbox
> /usr/local/bin/", the archive of
> this email is the only documentation I can
> find on the matter -- minus a
> mention of a /usr/local/bin/pdfbox wrapper script
> which I can't find the
> source for (suspected brew/tap/macport type culprit, but
> no hits).
>
> When I look through the PDFBOX command line tutorial I can't find
> mention
> of /usr/local/bin either.
>
> Here is a good stackoverflow article
> discussing where to put JAR files in
> general and in which scenarios you should
> and shouldn't use the
> classpath
> suggestions:
>
> http://stackoverflow.com/questions/12842063/where-to-install-jar-files-on-os-x-so-other-java-applications-will-find-them
>
>   
>
>


Re: Shell Can't Find pdfbox

Posted by Jonathan Levi <dr...@aol.com>.
The documentation is at https://pdfbox.apache.org/1.8/commandline.html. All I see is the suggested command line format, i.e., for the Decrypt command:

usage: java -jar pdfbox-app-x.y.z.jar Decrypt [OPTIONS] <inputfile> [outputfile]

 

 As for theStackoverflow article: I copied the pdfbox JAR into ~/Library/Java/Extensions, restarted the computer, and verified:

jonathan$ ls ~/Library/Java/Extensions
pdfbox-app-1.8.10.jar

I then attempted to run the pdfbox JAR using the -classpath option:

jonathan$ java -classpath ~/Library/Java/Extensions/pdfbox-app-1.8.10.jar \
> -jar pdfbox-app-1.8.10.jar ExtractText afile.pdf afile.txt; cat afile.txt
Error: Unable to access jarfile pdfbox-app-1.8.10.jar
cat: afile.txt: No such file or directory

Finally, I ran the pdfbox JAR using its full path:

jonathan$ java -jar ~/Library/Java/Extensions/pdfbox-app-1.8.10.jar \
> ExtractText afile.pdf afile.txt; cat afile.txt
(Text)


 

-----Original Message-----
From: Tres Finocchiaro <tr...@gmail.com>
To: users <us...@pdfbox.apache.org>
Sent: Sat, Nov 7, 2015 9:33 pm
Subject: Re: Shell Can't Find pdfbox


> [...] it appears to be a different method than what the Apache
PDFBox
documentation specifies

Can you please provide a link to the
incorrect documentation?

No Java I've used recommends putting JAR files in a
UNIX PATH search
location.  The only possible thing I can think of is a wrapper
script
someone created as a helper.

When I search the Internet for "pdfbox
/usr/local/bin/", the archive of
this email is the only documentation I can
find on the matter -- minus a
mention of a /usr/local/bin/pdfbox wrapper script
which I can't find the
source for (suspected brew/tap/macport type culprit, but
no hits).

When I look through the PDFBOX command line tutorial I can't find
mention
of /usr/local/bin either.

Here is a good stackoverflow article
discussing where to put JAR files in
general and in which scenarios you should
and shouldn't use the
classpath
suggestions:

http://stackoverflow.com/questions/12842063/where-to-install-jar-files-on-os-x-so-other-java-applications-will-find-them

 


Re: Shell Can't Find pdfbox

Posted by Tres Finocchiaro <tr...@gmail.com>.
> [...] it appears to be a different method than what the Apache PDFBox
documentation specifies

Can you please provide a link to the incorrect documentation?

No Java I've used recommends putting JAR files in a UNIX PATH search
location.  The only possible thing I can think of is a wrapper script
someone created as a helper.

When I search the Internet for "pdfbox /usr/local/bin/", the archive of
this email is the only documentation I can find on the matter -- minus a
mention of a /usr/local/bin/pdfbox wrapper script which I can't find the
source for (suspected brew/tap/macport type culprit, but no hits).

When I look through the PDFBOX command line tutorial I can't find mention
of /usr/local/bin either.

Here is a good stackoverflow article discussing where to put JAR files in
general and in which scenarios you should and shouldn't use the classpath
suggestions:

http://stackoverflow.com/questions/12842063/where-to-install-jar-files-on-os-x-so-other-java-applications-will-find-them

Re: Shell Can't Find pdfbox

Posted by Jonathan Levi <dr...@aol.com>.
Well, that does work, although it appears to be a different method than what the Apache PDFBox documentation specifies. Thank you! JL
 

 

 

-----Original Message-----
From: Maruan Sahyoun <sa...@fileaffairs.de>
To: users <us...@pdfbox.apache.org>
Sent: Sat, Nov 7, 2015 12:36 pm
Subject: Re: Shell Can't Find pdfbox


Hi,

> Am 07.11.2015 um 17:30 schrieb Jonathan Levi <dr...@aol.com>:
> 
>

> Tilman and Andreas,
> 
> Thank you for your help. Unfortunately, I can't
make either suggestion work:
> 
> Tilman: I don't think the problem is a
missing $PATH entry. My pdfbox-app-1.8.10.jar is in /usr/local/bin:
> 
>
jonathan$ ls /usr/local/bin/pdfbox-app-1.8.10.jar
>
/usr/local/bin/pdfbox-app-1.8.10.jar
> 
> This is in $PATH:
> 
> jonathan$
echo $PATH
>
/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:.:/Users/jonathan/bin:/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Internet
Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin
> 
> 
> 
> Andreas: To
eliminate as much uncertainty over permissions as possible, I did
> 
>
jonathan$ chmod 777 /usr/local/bin/pdfbox-app-1.8.10.jar
> drj-air:Desktop
jonathan$ ls -al /usr/local/bin/pdfb*
> -rwxrwxrwx@ 1 jonathan  staff  10613055
Aug 16 13:26 /usr/local/bin/pdfbox-app-1.8.10.jar
> 
> (I don't understand the
@ flag: Is that the problem?) Anyway, it still doesn't work:
> 
> jonathan$
java -jar pdfbox-app-1.8.10.jar \
>> ExtractText aFile.pdf > aFile.txt; cat
aFile.txt
> Error: Unable to access jarfile pdfbox-app-1.8.10.jar
> 
> 
>
What seems to work, again, is to supply the full path of
pdfbox-app-1.8.10.jar:
> 
> jonathan$ java -jar
/usr/local/bin/pdfbox-app-1.8.10.jar \
>> ExtractText aFile.pdf > aFile.txt;
cat aFile.txt
> (Text)
> 
> which is also what I got before modifying
pdfbox-app-1.8.10.jar's permissions. Any further suggestions?


what you can
do is put the .jar in either /Library/Java/Extensions or
~/Library/Java/Extensions

the you can run the pdfbox app like this

java
org.apache.pdfbox.PDFBox <command> <args>

BR
Maruan


> 
> Jonathan
>

> 
> 
> -----Original Message-----
> From: Andreas Lehmkühler
<an...@lehmi.de>
> To: users <us...@pdfbox.apache.org>; Jonathan Levi
<dr...@aol.com>
> Sent: Tue, Nov 3, 2015 5:48 am
> Subject: Re: Shell Can't
Find pdfbox
> 
> 
> Hi,
> 
>> Jonathan Levi <dr...@aol.com> hat am 3.
November 2015 um 03:25
> geschrieben:
>> 
>> 
>> I'm finding that shell
commands to use
> pdfbox-app-1.8.10.jar won't work unless
>> the full path is
used. Example:
>> 
> 
>> drj-air:Desktop jonathan$ ls
/usr/local/bin/pdfb*
>> 
> /usr/local/bin/pdfbox-app-1.8.10.jar
>>
drj-air:Desktop jonathan$ java -jar
> pdfbox-app-1.8.10.jar ExtractText
>>
Contact-Office-Letter.pdf 
>> Error: Unable
> to access jarfile
pdfbox-app-1.8.10.jar
>> drj-air:Desktop jonathan$ java -jar
>
/usr/local/bin/pdfbox-app-1.8.10.jar
>> ExtractText
Contact-Office-Letter.pdf
> 
>> drj-air:Desktop jonathan$ 
>> 
>> Is there a
shell variable that has to be
> set for Java to know where to look
>> for
jars?
> I guess the issue might be that
> your user doesn't have sufficient
rights to
> access the jar.
> 
> Check the output
> of 
> 
> ls -al
/usr/local/bin/pdfb*
> 
> and change the access permissions if
> necessary
>

>> Using Mac OS X 10.11.1.
>> 
>> TIA,
>> 
>> 
> Jonathan
> 
> BR
>
Andreas
> 
> 
>



---------------------------------------------------------------------
To
unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional
commands, e-mail: users-help@pdfbox.apache.org


 

Re: Shell Can't Find pdfbox

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,

> Am 07.11.2015 um 17:30 schrieb Jonathan Levi <dr...@aol.com>:
> 
> 
> Tilman and Andreas,
> 
> Thank you for your help. Unfortunately, I can't make either suggestion work:
> 
> Tilman: I don't think the problem is a missing $PATH entry. My pdfbox-app-1.8.10.jar is in /usr/local/bin:
> 
> jonathan$ ls /usr/local/bin/pdfbox-app-1.8.10.jar
> /usr/local/bin/pdfbox-app-1.8.10.jar
> 
> This is in $PATH:
> 
> jonathan$ echo $PATH
> /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:.:/Users/jonathan/bin:/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin
> 
> 
> 
> Andreas: To eliminate as much uncertainty over permissions as possible, I did
> 
> jonathan$ chmod 777 /usr/local/bin/pdfbox-app-1.8.10.jar
> drj-air:Desktop jonathan$ ls -al /usr/local/bin/pdfb*
> -rwxrwxrwx@ 1 jonathan  staff  10613055 Aug 16 13:26 /usr/local/bin/pdfbox-app-1.8.10.jar
> 
> (I don't understand the @ flag: Is that the problem?) Anyway, it still doesn't work:
> 
> jonathan$ java -jar pdfbox-app-1.8.10.jar \
>> ExtractText aFile.pdf > aFile.txt; cat aFile.txt
> Error: Unable to access jarfile pdfbox-app-1.8.10.jar
> 
> 
> What seems to work, again, is to supply the full path of pdfbox-app-1.8.10.jar:
> 
> jonathan$ java -jar /usr/local/bin/pdfbox-app-1.8.10.jar \
>> ExtractText aFile.pdf > aFile.txt; cat aFile.txt
> (Text)
> 
> which is also what I got before modifying pdfbox-app-1.8.10.jar's permissions. Any further suggestions?


what you can do is put the .jar in either /Library/Java/Extensions or ~/Library/Java/Extensions

the you can run the pdfbox app like this

java org.apache.pdfbox.PDFBox <command> <args>

BR
Maruan


> 
> Jonathan
> 
> 
> 
> -----Original Message-----
> From: Andreas Lehmkühler <an...@lehmi.de>
> To: users <us...@pdfbox.apache.org>; Jonathan Levi <dr...@aol.com>
> Sent: Tue, Nov 3, 2015 5:48 am
> Subject: Re: Shell Can't Find pdfbox
> 
> 
> Hi,
> 
>> Jonathan Levi <dr...@aol.com> hat am 3. November 2015 um 03:25
> geschrieben:
>> 
>> 
>> I'm finding that shell commands to use
> pdfbox-app-1.8.10.jar won't work unless
>> the full path is used. Example:
>> 
> 
>> drj-air:Desktop jonathan$ ls /usr/local/bin/pdfb*
>> 
> /usr/local/bin/pdfbox-app-1.8.10.jar
>> drj-air:Desktop jonathan$ java -jar
> pdfbox-app-1.8.10.jar ExtractText
>> Contact-Office-Letter.pdf 
>> Error: Unable
> to access jarfile pdfbox-app-1.8.10.jar
>> drj-air:Desktop jonathan$ java -jar
> /usr/local/bin/pdfbox-app-1.8.10.jar
>> ExtractText Contact-Office-Letter.pdf
> 
>> drj-air:Desktop jonathan$ 
>> 
>> Is there a shell variable that has to be
> set for Java to know where to look
>> for jars?
> I guess the issue might be that
> your user doesn't have sufficient rights to
> access the jar.
> 
> Check the output
> of 
> 
> ls -al /usr/local/bin/pdfb*
> 
> and change the access permissions if
> necessary
> 
>> Using Mac OS X 10.11.1.
>> 
>> TIA,
>> 
>> 
> Jonathan
> 
> BR
> Andreas
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Shell Can't Find pdfbox

Posted by Jonathan Levi <dr...@aol.com>.
Tilman and Andreas,

Thank you for your help. Unfortunately, I can't make either suggestion work:
 
Tilman: I don't think the problem is a missing $PATH entry. My pdfbox-app-1.8.10.jar is in /usr/local/bin:

jonathan$ ls /usr/local/bin/pdfbox-app-1.8.10.jar
/usr/local/bin/pdfbox-app-1.8.10.jar

This is in $PATH:

jonathan$ echo $PATH
/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:.:/Users/jonathan/bin:/opt/local/bin:/opt/local/sbin:/sw/bin:/sw/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin

 

 Andreas: To eliminate as much uncertainty over permissions as possible, I did

jonathan$ chmod 777 /usr/local/bin/pdfbox-app-1.8.10.jar
drj-air:Desktop jonathan$ ls -al /usr/local/bin/pdfb*
-rwxrwxrwx@ 1 jonathan  staff  10613055 Aug 16 13:26 /usr/local/bin/pdfbox-app-1.8.10.jar

(I don't understand the @ flag: Is that the problem?) Anyway, it still doesn't work:

jonathan$ java -jar pdfbox-app-1.8.10.jar \
> ExtractText aFile.pdf > aFile.txt; cat aFile.txt
Error: Unable to access jarfile pdfbox-app-1.8.10.jar


 What seems to work, again, is to supply the full path of pdfbox-app-1.8.10.jar:

jonathan$ java -jar /usr/local/bin/pdfbox-app-1.8.10.jar \
> ExtractText aFile.pdf > aFile.txt; cat aFile.txt
(Text)

which is also what I got before modifying pdfbox-app-1.8.10.jar's permissions. Any further suggestions?

Jonathan



-----Original Message-----
From: Andreas Lehmkühler <an...@lehmi.de>
To: users <us...@pdfbox.apache.org>; Jonathan Levi <dr...@aol.com>
Sent: Tue, Nov 3, 2015 5:48 am
Subject: Re: Shell Can't Find pdfbox


Hi,

> Jonathan Levi <dr...@aol.com> hat am 3. November 2015 um 03:25
geschrieben:
> 
> 
> I'm finding that shell commands to use
pdfbox-app-1.8.10.jar won't work unless
> the full path is used. Example:
>

> drj-air:Desktop jonathan$ ls /usr/local/bin/pdfb*
>
/usr/local/bin/pdfbox-app-1.8.10.jar
> drj-air:Desktop jonathan$ java -jar
pdfbox-app-1.8.10.jar ExtractText
> Contact-Office-Letter.pdf 
> Error: Unable
to access jarfile pdfbox-app-1.8.10.jar
> drj-air:Desktop jonathan$ java -jar
/usr/local/bin/pdfbox-app-1.8.10.jar
> ExtractText Contact-Office-Letter.pdf

> drj-air:Desktop jonathan$ 
> 
> Is there a shell variable that has to be
set for Java to know where to look
> for jars?
I guess the issue might be that
your user doesn't have sufficient rights to
access the jar.

Check the output
of 

ls -al /usr/local/bin/pdfb*

and change the access permissions if
necessary

> Using Mac OS X 10.11.1.
> 
> TIA,
> 
>
Jonathan

BR
Andreas

 


Re: Shell Can't Find pdfbox

Posted by Andreas Lehmkühler <an...@lehmi.de>.
Hi,

> Jonathan Levi <dr...@aol.com> hat am 3. November 2015 um 03:25 geschrieben:
> 
> 
> I'm finding that shell commands to use pdfbox-app-1.8.10.jar won't work unless
> the full path is used. Example:
> 
> drj-air:Desktop jonathan$ ls /usr/local/bin/pdfb*
> /usr/local/bin/pdfbox-app-1.8.10.jar
> drj-air:Desktop jonathan$ java -jar pdfbox-app-1.8.10.jar ExtractText
> Contact-Office-Letter.pdf 
> Error: Unable to access jarfile pdfbox-app-1.8.10.jar
> drj-air:Desktop jonathan$ java -jar /usr/local/bin/pdfbox-app-1.8.10.jar
> ExtractText Contact-Office-Letter.pdf 
> drj-air:Desktop jonathan$ 
> 
> Is there a shell variable that has to be set for Java to know where to look
> for jars?
I guess the issue might be that your user doesn't have sufficient rights to
access the jar.

Check the output of 

ls -al /usr/local/bin/pdfb*

and change the access permissions if necessary

> Using Mac OS X 10.11.1.
> 
> TIA,
> 
> Jonathan

BR
Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Re: Shell Can't Find pdfbox

Posted by Tilman Hausherr <TH...@t-online.de>.
Am 03.11.2015 um 03:25 schrieb Jonathan Levi:
> I'm finding that shell commands to use pdfbox-app-1.8.10.jar won't work unless the full path is used. Example:
>
> drj-air:Desktop jonathan$ ls /usr/local/bin/pdfb*
> /usr/local/bin/pdfbox-app-1.8.10.jar
> drj-air:Desktop jonathan$ java -jar pdfbox-app-1.8.10.jar ExtractText Contact-Office-Letter.pdf
> Error: Unable to access jarfile pdfbox-app-1.8.10.jar
> drj-air:Desktop jonathan$ java -jar /usr/local/bin/pdfbox-app-1.8.10.jar ExtractText Contact-Office-Letter.pdf
> drj-air:Desktop jonathan$

Unless something changed in the last 30 years, the PATH variable is for 
the executable, i.e. java.

Tilman

>
> Is there a shell variable that has to be set for Java to know where to look for jars?
>
> Using Mac OS X 10.11.1.
>
> TIA,
>
> Jonathan
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org