Xcode sent me off on a false trail last night. It still plays me up when I try to incorporate libj.dylib in the bundle "resources". It does not misbehave if I rename it to libj.txt (say). So I suspect an ad-hoc security measure.
But if I manually insert libj.dylib into the bundle after Xcode builds it, in the Resources folder alongside jconsole, I can confirm that jconsole does indeed see it. Apple Activity Monitor confirms that the correct copy of jconsole is being run, with the correct copy of libj.dylib. So I don't need the -lib argument Eric told me about. I've got as far as establishing that my app successfully launches an embedded jconsole, which gets as far as loading profile.ijs and building SystemFolders_j_ (…and getting it wrong – no surprise at this stage). So, thank you @Bill and @Eric. Now I can see my way clear to rewriting profile.ijs and building a cutdown J installation inside my app. But only when the time comes. Until then I shall run an external copy of jconsole inside an intact J release, as I have been doing. On Wed, Apr 26, 2017 at 3:07 AM, bill lam <[email protected]> wrote: > jconsole already has tried hard to find the absolute path of itself. For > mac, it calls > _NSGetExecutablePath > in jeload.c , you may debug to find why it failed to load libj.dylib. if > the result from the function call is correct, then it should a security > issue or bundle cannot be accessed as a normal file system. > > On 26 Apr, 2017 9:51 am, "Ian Clark" <[email protected]> wrote: > > > Thanks, @Bill. I looked for a man-file and searched the wiki but > overlooked > > the user manual. > > > > @Eric - thanks, that may solve my problem. > > > > Is it a "real" problem? Yes. > > > > Do I really need it – for the end-user? Maybe / maybe not. > > > > I'm trying to embed jconsole directly in a Mac app, to simplify > > distribution to non-J-experts. Currently I need to instruct the customer > to > > install J, and the app launches jconsole via a fixed absolute > > path: /Applications/j64-805/bin/jconsole > > > > I could solve the problem with a fully-fledged installer, but I'd rather > > offer a single monolithic app which can simply be downloaded and run from > > anywhere. > > > > An app is really a disguised folder called a "bundle". Apart from that, > it > > acts like an ordinary folder for most purposes… > > Except for libj.dylib (ideally needs to go in the bundle too), which > Xcode > > is being unexpectedly awkward about, in ways I don't fully understand. > > Everything I've tried so far gets defeated: jconsole runs with a command > > line but reports it can't find its dylib, even though I copy it to the > same > > directory inside the bundle. I suspect it's yet another ad-hoc security > > band-aid from Apple. > > > > I reason that if I actually tell jconsole where libj.dylib is (…the one I > > want it to use), that might fix it. Will report back when I've made sense > > of what works and what doesn't. There's a raft of things to try. > > > > > > On Wed, Apr 26, 2017 at 12:35 AM, Eric Iverson <[email protected] > > > > wrote: > > > > > A recent (806) change to jconsole added an undocumented new parameter: > > -lib > > > path/jlib.dylib > > > > > > It is undocumented because I figured it should only be used in special > > > development circumstances. It would be interesting if you have a real > use > > > case for normal use. > > > > > > On Tue, Apr 25, 2017 at 6:15 PM, Ian Clark <[email protected]> > > wrote: > > > > > > > OS X questions... > > > > > > > > On what default path does jconsole expect to find libj.dylib ? > > > > > > > > Can the actual path be specified as a command line argument to > > jconsole? > > > > > > > > Where can I find a list of permissible command line arguments for > > > jconsole? > > > > ------------------------------------------------------------ > ---------- > > > > For information about J forums see http://www.jsoftware.com/ > forums.htm > > > ---------------------------------------------------------------------- > > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
