Mavericks External tools classpath issue?
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 56
- Joined: Fri Jun 06, 2008 8:05 pm
Mavericks External tools classpath issue?
Hi,
Since upgrading to Mac OS X 10.9 (Mavericks), I am unable to fire off scripts via the External Tools toolbar. My scripts, which rely on ant, are set up like this (from my project.xpr file):
When I click on this item in the External Tools menu I get this error:
But oXygen isn't able to find ant. Do you have any suggestions? Thanks in advance!
Joe
Since upgrading to Mac OS X 10.9 (Mavericks), I am unable to fire off scripts via the External Tools toolbar. My scripts, which rely on ant, are set up like this (from my project.xpr file):
Code: Select all
<xsltCustomEngines>
<field name="outEncoding">
<null/>
</field>
<field name="errEncoding">
<null/>
</field>
<field name="cmd">
<String xml:space="preserve">ant wipe-exist-data</String>
</field>
<field name="description">
<String xml:space="preserve">Completely deletes the contents of the database (eXist-db should not be running)</String>
</field>
<field name="name">
<String xml:space="preserve">wipe-exist-data</String>
</field>
<field name="workingDirectory">
<String xml:space="preserve">${pd}/build</String>
</field>
<field name="keyStroke">
<null/>
</field>
<field name="isBuiltin">
<Boolean xml:space="preserve">false</Boolean>
</field>
</xsltCustomEngines>
Ant is no longer bundled with Mac OS X under 10.9, but I installed ant via the homebrew package manager (http://brew.sh/). From the command line, I can run this same ant task successfully:Could not start: Cannot run program "ant" (in directory "/Users/joe/workspace/paho-trunk/build"): error=2, No such file or directory
Process ended with exit code: -1234567
Code: Select all
$ cd ~/workspace/paho-trunk/build
$ ant wipe-exist-data
Joe
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Mavericks External tools classpath issue?
Hello,
Did you try restarting Oxygen or your Mac since you've installed the ANT homebrew package?
Changes in the system PATH are not immediately applied to already running applications.
Alternatively, note that Oxygen has its own ANT distribution in Oxygen/tools/ant, so you could refer that one in your external tool: ${oxygenHome}/tools/ant
Regards,
Adrian
Did you try restarting Oxygen or your Mac since you've installed the ANT homebrew package?
Changes in the system PATH are not immediately applied to already running applications.
Alternatively, note that Oxygen has its own ANT distribution in Oxygen/tools/ant, so you could refer that one in your external tool: ${oxygenHome}/tools/ant
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 56
- Joined: Fri Jun 06, 2008 8:05 pm
Re: Mavericks External tools classpath issue?
Hi Adrian,
If I replace the command Oxygen executes with the absolute path to /usr/local/bin/ant (the path where homebrew installed it), the command in Oxygen works:
Thanks for the tip about referencing Oxygen's built-in copy of Ant. I may need to use that one instead.
That said, I'd like to think that Oxygen should be able to execute commands that work on the command line. Since this worked just fine on Mac OS X 10.8, could it be that something changed with 10.9 that's messing with Oxygen's path?
Yes, after reading your message, I restarted the Mac, and even then, after reopening Oxygen, ant wasn't recognized.adrian wrote:Did you try restarting Oxygen or your Mac since you've installed the ANT homebrew package?
Changes in the system PATH are not immediately applied to already running applications.
If I replace the command Oxygen executes with the absolute path to /usr/local/bin/ant (the path where homebrew installed it), the command in Oxygen works:
Code: Select all
<field name="cmd">
<String>/usr/local/bin/ant prepare-for-development</String>
</field>
That said, I'd like to think that Oxygen should be able to execute commands that work on the command line. Since this worked just fine on Mac OS X 10.8, could it be that something changed with 10.9 that's messing with Oxygen's path?
-
- Posts: 56
- Joined: Fri Jun 06, 2008 8:05 pm
Re: Mavericks External tools classpath issue?
Some updates on my attempts to fire an ant task from Oxygen's External Tools toolbar under Mavericks 10.9.
I tried Adrian's suggestion to use ${oxygenHome}/tools/ant - but I got an error:
But note that the execute permission for this version of Ant is not on by default. I think two steps may be needed - the first seems like the longer term fix, and the second a no-brainer but not very helpful:
1. Investigate why 10.9 broke oXygen's ability to run a command like /usr/local/bin, even though it has execute permissions. Is it some kind of sandboxing policy by the OS or a recent Java security setting?
2. Ship oXygen's tools/ant with execute permissions on by default.
Thanks for your consideration. I'm happy to try more troubleshooting steps or report any info that could be helpful.
I tried Adrian's suggestion to use ${oxygenHome}/tools/ant - but I got an error:
Seeing the double slash (//tools), I modified the .xpr file's command to use ${oxygenHome}tools/ant - but I got an error again:Cannot run program "file:/Applications/oxygen//tools/ant"... error=2, No such file or directory
So I looked in oxygen's tools/ant directory and found that the ant binary is deeper: tools/ant/bin/ant. I tested this from the command line but got a permissions error:Cannot run program "file:/Applications/oxygen/tools/ant"... error=2, No such file or directory
So I ran chmod +x on this file, and then could execute the ant binary from the command line. But, even when I set my .xpr file to this new location, I get the same error:$ /Applications/oxygen/tools/ant/bin/ant
-bash: /Applications/oxygen/tools/ant/bin/ant: Permission denied
Figuring that the file:/ prefix might be the cause of the problem, I replaced the ${oxygenHome} variable with ${oxygenInstallDir}. Once I re-added the / (slash) following this variable, I was finally able to execute ant via my External Tools toolbar.Could not start: Cannot run program "file:/Applications/oxygen/tools/ant/bin/ant" (in directory "/Users/joe/workspace/paho-trunk/build"): error=2, No such file or directory
Process ended with exit code: -1234567
But note that the execute permission for this version of Ant is not on by default. I think two steps may be needed - the first seems like the longer term fix, and the second a no-brainer but not very helpful:
1. Investigate why 10.9 broke oXygen's ability to run a command like /usr/local/bin, even though it has execute permissions. Is it some kind of sandboxing policy by the OS or a recent Java security setting?
2. Ship oXygen's tools/ant with execute permissions on by default.
Thanks for your consideration. I'm happy to try more troubleshooting steps or report any info that could be helpful.
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Mavericks External tools classpath issue?
Hi,
Sorry about the confusion with ${oxygenHome} (URL). ${oxygenInstallDir}/tools/ant/bin/ant is the right way to go. You can even work around the lack of executable flag by using:
1. '/usr/local/bin' is not in the system PATH and that's why Oxygen doesn't find the ant located there. I created a new external tool in Oxygen that runs printenv and the PATH was:
If I run the same in the Terminal window I get:
Note the '/usr/local/bin' at the end which explains why ant works in the Terminal but not in Oxygen.
I've checked in OS X 10.8 and the paths were the same, the difference between 10.8 and 10.9 is that in 10.8 ant was located in '/usr/bin' and in 10.9 it is installed in '/usr/local/bin' (which is not set in the system PATH).
There's a rather extensive topic on StackOverflow about setting environment variables and the PATH variable in particular in OS X:
Setting environment variables in OS X?
2. I've submitted an issue to set the executable flag for the ant script bundled with Oxygen.
Regards,
Adrian
Sorry about the confusion with ${oxygenHome} (URL). ${oxygenInstallDir}/tools/ant/bin/ant is the right way to go. You can even work around the lack of executable flag by using:
Code: Select all
/bin/sh "${oxygenInstallDir}/tools/ant/bin/ant"
Code: Select all
PATH=/usr/bin:/bin:/usr/sbin:/sbin
Code: Select all
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
I've checked in OS X 10.8 and the paths were the same, the difference between 10.8 and 10.9 is that in 10.8 ant was located in '/usr/bin' and in 10.9 it is installed in '/usr/local/bin' (which is not set in the system PATH).
There's a rather extensive topic on StackOverflow about setting environment variables and the PATH variable in particular in OS X:
Setting environment variables in OS X?
2. I've submitted an issue to set the executable flag for the ant script bundled with Oxygen.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 56
- Joined: Fri Jun 06, 2008 8:05 pm
Re: Mavericks External tools classpath issue?
Dear Adrian,
Your suggestion to prepend the command with 'sh' worked perfectly. Thanks so much for providing not only great oXygen support but also expert support of the host operating system! Relying on oXygen's bundled Ant app really simplifies the task of setting up new systems for my team, particularly now that Macs running Mavericks no longer can count on having Ant.
Many thanks, as always,
Joe
Your suggestion to prepend the command with 'sh' worked perfectly. Thanks so much for providing not only great oXygen support but also expert support of the host operating system! Relying on oXygen's bundled Ant app really simplifies the task of setting up new systems for my team, particularly now that Macs running Mavericks no longer can count on having Ant.
Many thanks, as always,
Joe
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service