Rob, Thanks for the replies. Yes, "cd %JENAROOT% returns the install path.
> There should be no need to change the CLASSPATH and it isn't used by the > batch scripts anyway I didn't think so, but the documentation is ambiguous. > Are you running the batch files by their full name i.e. type 'arq.bat' > rather than just 'arq'? No need in Windows 7. The "PATHEXT" environment variable accounts for a number of common extensions including ".bat", and I suspect most "recent" Windows versions do as well. Problem solved, and here is why... For the Windows 7 "PATH" environment variable (not sure on other Windows versions): 1. Do not append this path: "...;%JENAROOT%\bat". For some strange reason, Windows 7 does not recognize user environment variables within system environment variables. 2. So, I replace it with the fully spelled "%JENAROOT%" path as follows. "...; C:\apache-jena-2.7.2\bat". This still does not work. Windows 7 does not allow whitespace characters after the semicolon delimiter. Instead, appending to the PATH variable's value as follows does work: "...;C:\apache-jena-2.7.2\bat" 3. Given the solution in "2" resolved my earlier problem, I revised the "PATH" variable by replacing the path spelled in "2" with my original apache-jena-2.7.2 path, namely "...;C:\(placeholder)\Documents\_MyStuff\Semantics\ARQ\ARQ 2.9.2\apache-jena-2.7.2\bat" This also worked. Of course this makes sense, since Windows allows files names with whitespace characters, and not just Windows 7. Windows 7 install includes a "Program Files (x86)" directory name, and it does not complain when its PATH system environment variable's value contains this directory name. Regards, Anthony -----Original Message----- From: Rob Vesse [mailto:[email protected]] Sent: Thursday, July 26, 2012 12:34 PM To: [email protected] Subject: Re: Unable to Run Jena'a ARQ Command Line Utility On 7/26/12 8:37 AM, "ASPSA" <[email protected]> wrote: >Rob, > >> Yes there was an error here, there is a missing = in the README for >> the >Windows example that >> is present on the website, fixed in SVN. I also notice that the path >stated in the README reflects >> an old version of Jena so I fixed that as well >I accounted for the missing assignment operator and for the incorrect >version number when I assigned a value to the JENAROOT environment >variable. >My question was more to the full path needed as its value. > >Which one? (Understanding "\path\to\" is a placeholder) > >set JENAROOT=\path\to\apache-jena-2.7.2 This one, the class path is calculated relative to the base directory of the Jena distribution > >or > >set JENAROOT=\path\to\apache-jena-2.7.2\bat\sparql.bat --version > >If it is the latter, then why not set it to ...\bat\arq.bat? Also, >what is the purpose of "--version"? The --version is a command line option supported by all the command line scripts (as far as I know) which just prints the version of Jena used by the tool. Essentially running this is just a smoke test to ensure your environment is appropriately set up. If this works then you can run the commands properly and actually use them, running with --help should show you the usage for a given tool.cd > >> cd %JENAROOT% >I received the following error message. > >"The filename, directory name, or volume label syntax is incorrect." > >> If you get "The system cannot find the path specified" then it is set >incorrectly... >I checked multiple times on the path value. In fact I did not type it >in; I copied it from Window Explorer's address line to ensure I had the >accurate path spelling. So I'm not sure what the issue is here, if you can't do a cd %JENAROOT% then JENAROOT is incorrect in some way > >> When I make my path contain spaces I reliably hit this error, it >> looks >like the scripts don't actually >> handle paths containing spaces correctly. >As you suggest, I altered the apache-jena-2.7.2 install path such that >it contains no whitespace characters. Accordingly, I set the JENAROOT >environment variable as follows: > >set JENAROOT= C:\apache-jena-2.7.2 > >Additionally, I appended the following path spellings to the PATH and >CLASSPATH environmental variables. > >For PATH, I appended "%JENAROOT%\bat". > >For CLASSPATH, I appended "%JENAROOT\bin". There should be no need to change the CLASSPATH and it isn't used by the batch scripts anyway > >When I execute the arq.bat command, I received the following error >message: > >"'arq' is not recognized as an internal or external command, operable >program or batch file." > >Any thoughts? Are you running the batch files by their full name i.e. type 'arq.bat' rather than just 'arq'? While the Linux versions don't have/need file extensions for you to be able to run them the Windows batch scripts typically require the extension to be stated in order to run the commands (though this may vary depending on the version of Windows) Rob > >Thanks. > > >Anthony > >-----Original Message----- >From: Rob Vesse [mailto:[email protected]] >Sent: Wednesday, July 25, 2012 7:39 PM >To: [email protected] >Subject: Re: Unable to Run Jena'a ARQ Command Line Utility > >So I just went ahead and reproduced your steps, comments inline: > > >On 7/25/12 3:27 PM, "ASPSA" <[email protected]> wrote: > >>> The ARQ part is wrong. There should be no capitalized ARQ - that >>>looks more like an old (when ARQ was distributed separately) path. >>Let's start with the distribution I downloaded. Here are the links I >>followed. >> >>On the web page located at http://jena.apache.org/download/index.html, >>I clicked the http://www.apache.org/dist/jena/ link. This brought me >>to the "Apache Jena Releases" web page. On that page I selected the >"binaries/" >>hyperlink, which brought me to the "Index of /dist/jena/binaries" >>(http://www.apache.org/dist/jena/binaries/) web page. >> >>From that web page I downloaded the "apache-jena-2.7.2.zip" file, last >>modified on 02 Jul 2012. >> >>Is this the latest, stable release? >> >>If so, the distribution contains the "README" file attached in this >>response. Since all the text runs together when opening it in NotePad, >>I instead opened it in WordPad for better readability. An excerpt from >>that file follows. >> >><excerpt> >>Installing Jena >> --------------- >> >> To use Jena in your application, ensure all the .jar files in the lib/ >> directory are on the classpath or available to your web application. >>Jena >> is built and test with these .jar files. >> >> Scripts >> ------- >> >> The directories bat/ and bin/ provide script wrappers to run Jena >>command >> line tools. The scripts can be copied to a convenient place on the >> command path. >> >> To use the Jena tools from the command line you need to set the >> JENAROOT environment variable to point to the location where you >> have unzipped the Jena distribution: >> >> Windows: >> set JENAROOT \path\to\apache-jena-2.7.1 >> bat\sparql.bat --version >> >> Linux >> export JENAROOT=/path/to/apache-jena-2.7.1 >> bin/sparql --version >></excerpt> >> >>How precisely do you interpret setting up the JENAROOT environment >>variable in Window. What is stated in the README file is inconsistent >>with instructions provided at >>http://jena.apache.org/documentation/tools/: > >Yes there was an error here, there is a missing = in the README for the >Windows example that is present on the website, fixed in SVN. I also >notice that the path stated in the README reflects an old version of >Jena so I fixed that as well > >> >><quote> >>How to set up the CLASSPATH and run Jena command line tools >> >>On Linux / Mac >> >> export JENAROOT=the directory you downloaded Jena to >> export PATH=$PATH:$JENAROOT/bin >> >>On Windows >> >> SET JENAROOT=the directory you downloaded Jena to >> SET PATH=%PATH%;%JENAROOT%\bat >></quote> >> >>Bottom line: I still receive the same error message >> >>"Error: Could not find or load main class >>(...)\Documents\_MyStuff\Semantics\ARQ\ARQ" > >This error means that your JENAROOT is incorrect in some way, I hit the >same error initially and realized I had just typed the path in wrong > >One easy way to diagnose whether it is set correctly is to try the >following command after you've set JENAROOT: > >cd %JENAROOT% > >If you get "The system cannot find the path specified" then it is set >incorrectly, if it works then JENAROOT is set to a valid path. > >However if this works and you still get path errors then the question >becomes does your path contain any spaces? > >When I make my path contain spaces I reliably hit this error, it looks >like the scripts don't actually handle paths containing spaces >correctly. >I added an issue JENA-286 >(https://issues.apache.org/jira/browse/JENA-286) >for this bug and we will make sure this is fixed for the next release. > >Apologies for the inconvenience caused, in the meantime the workaround >is either to manually modify the scripts you need as shown in that bug >report or to move your location to a path without spaces in it > >Hope this helps, > >Rob Vesse > >> >>The path presented in this error message makes no sense. >> >>On my system the apache-jena-2.7.2 distribution install is >>"(...)\Documents\_MyStuff\Semantics\ARQ\ARQ 2.9.2\apache-jena-2.7.2". >> >>I set the JENAROOT environment variable to >>"(...)\Documents\_MyStuff\Semantics\ARQ\ARQ >>2.9.2\apache-jena-2.7.2C:\Users\Anthony >>Petosa\Documents\_MyStuff\Semantics\ARQ\ARQ 2.9.2\apache-jena-2.7.2". >> >>I appended the following path to the PATH variable: "%JENAROOT%\bat". >> >>Any thoughts? >> >>Thanks. >> >>-----Original Message----- >>From: Andy Seaborne [mailto:[email protected]] On Behalf >>Of Andy Seaborne >>Sent: Tuesday, July 24, 2012 5:17 PM >>To: [email protected] >>Subject: Re: Unable to Run Jena'a ARQ Command Line Utility >> >>On 24/07/12 19:28, ASPSA wrote: >>>> Sorry, I wasn't clear. >>> No problem, and I appreciate your responses. >>> >>> In addition to setting the environment, class and classpath variables: >>> >>> Environment >>> ---------------- >>> JENAROOT = ³<Apache Jena 2.7.2 distribution path>² >> >>Exactly what is this set to? >> >>[[ >>Error: Could not find or load main class <Apache Jena 2.7.2 >>distribution >>path>\ARQ >>]] >> >>The ARQ part is wrong. There should be no capitalized ARQ - that >>looks more like an old (when ARQ was distributed separately) path. >> >>> Path >>> ------ >>> Šother semicolon-delimited path entriesŠ, followed by <Apache Jena >>> 2.7.2 distribution path>\bat; <Apache Jena 2.7.2 distribution >>> path>\bin >> >>bat or bin -- not both. >> >>> >>> ClassPath >>> ------------ >>> Šother semicolon-delimited path entriesŠ, followed by <Apache Jena >>> 2.7.2 distribution path>\bat; <Apache Jena 2.7.2 distribution >>> path>\bin >> >>Not needed - the classpath is set by the scripts - have a look at >>arq.bat: >> >>You will see: >> >>[[ >>set JENA_CP="%JENAROOT%\lib\*;" >>]] >>and >>[[ >>java %JVM_ARGS% %LOGGING% -cp %JENA_CP% arq.arq %* ]] >> >>You can call the java command directly. >> >> >>> >>> I also include additional classpath values as prescribed here: >>>http://jena.sourceforge.net/ARQ/Tutorial/query1.html (under the >>>section "Using the Java command line applications directly". >>>Naturally, I added values commensurate with the aforementioned Jena >>>release and rebooted by system for good measure. >> >>jena.sourceforge.net is out-of-date. >> >>Please use the jena.apache.org site. >> >>If you go to : >>http://jena.sourceforge.net/ARQ/Tutorial/ >>http://jena.sourceforge.net/ARQ/ >> >>you get redirected to the Apache Jena site. >> >>The set up for apache-jena is different. See it's README. >> >>> >>> I continue to receive the same error message: >>> >>> Error: Could not find or load main class <Apache Jena 2.7.2 >>> distribution path>\ARQ >>> >>> >>> >>> -----Original Message----- >>> From: Joshua TAYLOR [mailto:[email protected]] >>> Sent: Tuesday, July 24, 2012 9:45 AM >>> To: [email protected] >>> Subject: Re: Unable to Run Jena'a ARQ Command Line Utility >>> >>>> -----Original Message----- >>>> From: Joshua TAYLOR [mailto:[email protected]] >>>> Sent: Monday, July 23, 2012 12:29 PM >>>> To: [email protected] >>>> Subject: Re: Unable to Run Jena'a ARQ Command Line Utility >>>> >>>> On Mon, Jul 23, 2012 at 12:10 PM, ASPSA <[email protected]> wrote: >>>>> I recently download the "apache-jena-2.7.2" distribution, which >>>>> includes "jena-arq-2.9.2.jar" under the "bin" directory. >>>>> Unfortunately, when I run the ARQ command line utility I receive >>>>> an error message. For example, when I execute >>>>> >>>>> arq --data <some valid Turtle file> --query <some valid SPARQL >>>>> query >>>>> file> >>>>> >>>>> the command line utility returns the following error: >>>>> >>>>> Error: Could not find or load main class <Apache Jena 2.7.2 >>>>> distribution >>>>> path>\ARQ >>>>> >>>>> I have the following environment, PATH and CLASSPATH variables >>>>> set, and I restarted my OS. >>>> >>>> Will ARQ run if you an absolute path and set just the JENAROOT >>>>variable? For instance, I can do the following: >>>> >>>> $ JENAROOT=/usr/local/lib/apache-jena-2.7.2/ >>>> /usr/local/lib/apache-jena-2.7.2/bin/arq >>>> No query string or query file >>>> >>>> (I'm not a Jena developer, but a satisfied user who makes lots of >>>> use of the command line utilities and recently switched to 2.7.2.) >>> >>> On Tue, Jul 24, 2012 at 8:43 AM, ASPSA <[email protected]> wrote: >>>> I assigned the JENAROOT variable an absolute path. I simply used >>>>"<Apache Jena 2.7.2 distribution path>\bat" in the post as a >>>>shortcut for the actual path. >>> >>> Sorry, I wasn't clear. I meant, what happens if you set JENAROOT >>> and use the absolute path to the executable (so as to confirm that >>> the problem isn't with the value of PATH). But since you're getting >>> a Java error and not a shell error, I guess ARQ is running, at least. >>> I was just trying to decrease the number of things that could be the >>> problem. //JT >>> >>> -- >>> Joshua Taylor, http://www.cs.rpi.edu/~tayloj/ >>> >>> >> > > >
