You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Paquin, Brian" <br...@yale.edu> on 2016/02/12 16:20:08 UTC

Tomcat Native install on Mac OS X 10.11

I have used http://www.malisphoto.com/tips/tomcatonosx.html#Anchor-Native to setup Native with Tomcat successfully.
Specifically, I create /usr/lib/java and then do:

# Copy the native library to /usr/lib/java
sudo cp .libs/libtcnative-1.0.dylib /usr/lib/java

# Create a symbolic link in /usr/lib/java to the native library
cd /usr/lib/java
sudo ln -sfhv libtcnative-1.0.dylib libtcnative-1.dylib
sudo ln -sfhv libtcnative-1.dylib libtcnative-1.jnilib

This has worked up to 10.10, but NOT in 10.11 - Apple uses SIP to block changes to /usr/lib/ (and removes /usr/lib/java during an OS upgrade!).

Is there a newer way (not modifying /usr/lib) that I can use to get Native to work with 10.11?
(I understand I can disable SIP with “csrutil”, but I would like to keep SIP enabled)

[Yale Pathology Logo]
Brian Paquin
Help Desk Support Yale Pathology ITS
---------------------------------------------------
310 Cedar St. BML B50
New Haven, CT 06520
203-785-3691-office
203-785-2403-fax


Re: Tomcat Native install on Mac OS X 10.11

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Brian,

On 2/12/16 12:45 PM, Paquin, Brian wrote:
> 
>> On Feb 12, 2016, at 12:06 PM, Mark Thomas <ma...@apache.org>
>> wrote:
>> 
>> On 12/02/2016 16:14, Paquin, Brian wrote:
>>> On Feb 12, 2016, at 10:20 AM, Paquin, Brian
>>> <br...@yale.edu>> wrote:
>>> 
>>> I have used
>>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.malisphoto.c
om_tips_tomcatonosx.html-23Anchor-2DNative&d=AwIGaQ&c=-dg2m7zWuuDZ0MUcV7
Sdqw&r=jc-EqZyK6fWys6oTdMgtt9CjzHj-k5sGu3EHT7qx4Jg&m=0LOe6lb2cVwrFRRSnpE
UFLkVSolnvDja54Q61QvEv88&s=Kp0e2ukimi9fwrD-pru-iYltyR8cNbD68Wi3Gcmh3c8&e
=
>>> to setup Native with Tomcat successfully. Specifically, I
>>> create /usr/lib/java and then do:
>>> 
>>> # Copy the native library to /usr/lib/java sudo cp
>>> .libs/libtcnative-1.0.dylib /usr/lib/java
>>> 
>>> # Create a symbolic link in /usr/lib/java to the native
>>> library cd /usr/lib/java sudo ln -sfhv libtcnative-1.0.dylib
>>> libtcnative-1.dylib sudo ln -sfhv libtcnative-1.dylib
>>> libtcnative-1.jnilib
>>> 
>>> This has worked up to 10.10, but NOT in 10.11 - Apple uses SIP
>>> to block changes to /usr/lib/ (and removes /usr/lib/java during
>>> an OS upgrade!).
>>> 
>>> Is there a newer way (not modifying /usr/lib) that I can use to
>>> get Native to work with 10.11? (I understand I can disable SIP
>>> with “csrutil”, but I would like to keep SIP enabled)
>>> 
>>> 
>>> Solved. Used /Library/Java/Extensions instead of
>>> /usr/lib/java.
>> 
>> You can install the library anywhere. You just need to tell
>> Tp,cat where it is. Personally I build in the the same location I
>> store all the various JARs I have downloaded. (~/libs)
>> 
>> Mark
> 
> 
> What file do I modify?

You need to set either the LD_LIBRARY_PATH environment variable or the
JVM system property java.library.path.

The official documentation[1] shows the use of LD_LIBRARY_PATH on *NIX
systems and the PATH environment variable on Windows systems. I prefer
using java.libary.path system property myself, since it only effects
how Java loads libraries loaded with System.loadLibrary and doesn't
effect how the OS's loader loads libraries in general.

- -chris

[1] https://tomcat.apache.org/native-doc/
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAla+LPQACgkQ9CaO5/Lv0PDygACgmmKm4iFy468U3fd8kp7TikeK
pZEAoMQbRpXinJXkqCnYB5dWkuM79AOm
=kUWz
-----END PGP SIGNATURE-----

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


Re: Tomcat Native install on Mac OS X 10.11

Posted by "Paquin, Brian" <br...@yale.edu>.
> On Feb 12, 2016, at 12:06 PM, Mark Thomas <ma...@apache.org> wrote:
> 
> On 12/02/2016 16:14, Paquin, Brian wrote:
>> On Feb 12, 2016, at 10:20 AM, Paquin, Brian <br...@yale.edu>> wrote:
>> 
>> I have used https://urldefense.proofpoint.com/v2/url?u=http-3A__www.malisphoto.com_tips_tomcatonosx.html-23Anchor-2DNative&d=AwIGaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=jc-EqZyK6fWys6oTdMgtt9CjzHj-k5sGu3EHT7qx4Jg&m=0LOe6lb2cVwrFRRSnpEUFLkVSolnvDja54Q61QvEv88&s=Kp0e2ukimi9fwrD-pru-iYltyR8cNbD68Wi3Gcmh3c8&e=  to setup Native with Tomcat successfully.
>> Specifically, I create /usr/lib/java and then do:
>> 
>> # Copy the native library to /usr/lib/java
>> sudo cp .libs/libtcnative-1.0.dylib /usr/lib/java
>> 
>> # Create a symbolic link in /usr/lib/java to the native library
>> cd /usr/lib/java
>> sudo ln -sfhv libtcnative-1.0.dylib libtcnative-1.dylib
>> sudo ln -sfhv libtcnative-1.dylib libtcnative-1.jnilib
>> 
>> This has worked up to 10.10, but NOT in 10.11 - Apple uses SIP to block changes to /usr/lib/ (and removes /usr/lib/java during an OS upgrade!).
>> 
>> Is there a newer way (not modifying /usr/lib) that I can use to get Native to work with 10.11?
>> (I understand I can disable SIP with “csrutil”, but I would like to keep SIP enabled)
>> 
>> 
>> Solved. Used /Library/Java/Extensions instead of /usr/lib/java.
> 
> You can install the library anywhere. You just need to tell Tp,cat where
> it is. Personally I build in the the same location I store all the
> various JARs I have downloaded. (~/libs)
> 
> Mark


What file do I modify?

Thank you,  Brian Paquin



Re: Tomcat Native install on Mac OS X 10.11

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mark,

On 2/12/16 12:06 PM, Mark Thomas wrote:
> On 12/02/2016 16:14, Paquin, Brian wrote:
>> On Feb 12, 2016, at 10:20 AM, Paquin, Brian
>> <br...@yale.edu>> wrote:
>> 
>> I have used
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.malisphoto.co
m_tips_tomcatonosx.html-23Anchor-2DNative&d=AwIGaQ&c=-dg2m7zWuuDZ0MUcV7S
dqw&r=jc-EqZyK6fWys6oTdMgtt9CjzHj-k5sGu3EHT7qx4Jg&m=0LOe6lb2cVwrFRRSnpEU
FLkVSolnvDja54Q61QvEv88&s=Kp0e2ukimi9fwrD-pru-iYltyR8cNbD68Wi3Gcmh3c8&e=
>> to setup Native with Tomcat successfully. Specifically, I create
>> /usr/lib/java and then do:
>> 
>> # Copy the native library to /usr/lib/java sudo cp
>> .libs/libtcnative-1.0.dylib /usr/lib/java
>> 
>> # Create a symbolic link in /usr/lib/java to the native library 
>> cd /usr/lib/java sudo ln -sfhv libtcnative-1.0.dylib
>> libtcnative-1.dylib sudo ln -sfhv libtcnative-1.dylib
>> libtcnative-1.jnilib
>> 
>> This has worked up to 10.10, but NOT in 10.11 - Apple uses SIP to
>> block changes to /usr/lib/ (and removes /usr/lib/java during an
>> OS upgrade!).
>> 
>> Is there a newer way (not modifying /usr/lib) that I can use to
>> get Native to work with 10.11? (I understand I can disable SIP
>> with “csrutil”, but I would like to keep SIP enabled)
>> 
>> 
>> Solved. Used /Library/Java/Extensions instead of /usr/lib/java.
> 
> You can install the library anywhere. You just need to tell Tp,cat
> where it is.

+1

> Personally I build in the the same location I store all the various
> JARs I have downloaded. (~/libs)

I put mine into Tomcat's CATALINA_HOME/bin/ directory so it always
matches the version of Tomcat being used (in case there is a version
requirement).

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAla+K6IACgkQ9CaO5/Lv0PC8RACdFqrn8OVIuF5BORSRMwihXE5E
N/YAn1A3zIlNtMXs/pi+3Qv3QrNUVYuL
=mhUq
-----END PGP SIGNATURE-----

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


Re: Tomcat Native install on Mac OS X 10.11

Posted by Mark Thomas <ma...@apache.org>.
On 12/02/2016 16:14, Paquin, Brian wrote:
> On Feb 12, 2016, at 10:20 AM, Paquin, Brian <br...@yale.edu>> wrote:
> 
> I have used https://urldefense.proofpoint.com/v2/url?u=http-3A__www.malisphoto.com_tips_tomcatonosx.html-23Anchor-2DNative&d=AwIGaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=jc-EqZyK6fWys6oTdMgtt9CjzHj-k5sGu3EHT7qx4Jg&m=0LOe6lb2cVwrFRRSnpEUFLkVSolnvDja54Q61QvEv88&s=Kp0e2ukimi9fwrD-pru-iYltyR8cNbD68Wi3Gcmh3c8&e=  to setup Native with Tomcat successfully.
> Specifically, I create /usr/lib/java and then do:
> 
> # Copy the native library to /usr/lib/java
> sudo cp .libs/libtcnative-1.0.dylib /usr/lib/java
> 
> # Create a symbolic link in /usr/lib/java to the native library
> cd /usr/lib/java
> sudo ln -sfhv libtcnative-1.0.dylib libtcnative-1.dylib
> sudo ln -sfhv libtcnative-1.dylib libtcnative-1.jnilib
> 
> This has worked up to 10.10, but NOT in 10.11 - Apple uses SIP to block changes to /usr/lib/ (and removes /usr/lib/java during an OS upgrade!).
> 
> Is there a newer way (not modifying /usr/lib) that I can use to get Native to work with 10.11?
> (I understand I can disable SIP with “csrutil”, but I would like to keep SIP enabled)
> 
> 
> Solved. Used /Library/Java/Extensions instead of /usr/lib/java.

You can install the library anywhere. You just need to tell Tp,cat where
it is. Personally I build in the the same location I store all the
various JARs I have downloaded. (~/libs)

Mark


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


Re: Tomcat Native install on Mac OS X 10.11

Posted by "Paquin, Brian" <br...@yale.edu>.
On Feb 12, 2016, at 10:20 AM, Paquin, Brian <br...@yale.edu>> wrote:

I have used https://urldefense.proofpoint.com/v2/url?u=http-3A__www.malisphoto.com_tips_tomcatonosx.html-23Anchor-2DNative&d=AwIGaQ&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=jc-EqZyK6fWys6oTdMgtt9CjzHj-k5sGu3EHT7qx4Jg&m=0LOe6lb2cVwrFRRSnpEUFLkVSolnvDja54Q61QvEv88&s=Kp0e2ukimi9fwrD-pru-iYltyR8cNbD68Wi3Gcmh3c8&e=  to setup Native with Tomcat successfully.
Specifically, I create /usr/lib/java and then do:

# Copy the native library to /usr/lib/java
sudo cp .libs/libtcnative-1.0.dylib /usr/lib/java

# Create a symbolic link in /usr/lib/java to the native library
cd /usr/lib/java
sudo ln -sfhv libtcnative-1.0.dylib libtcnative-1.dylib
sudo ln -sfhv libtcnative-1.dylib libtcnative-1.jnilib

This has worked up to 10.10, but NOT in 10.11 - Apple uses SIP to block changes to /usr/lib/ (and removes /usr/lib/java during an OS upgrade!).

Is there a newer way (not modifying /usr/lib) that I can use to get Native to work with 10.11?
(I understand I can disable SIP with “csrutil”, but I would like to keep SIP enabled)


Solved. Used /Library/Java/Extensions instead of /usr/lib/java.

Brian Paquin

[Yale Pathology Logo]
Brian Paquin
Help Desk Support Yale Pathology ITS
---------------------------------------------------
310 Cedar St. BML B50
New Haven, CT 06520
203-785-3691-office
203-785-2403-fax