1

I am trying to host my Java project on a remote linux host(CentOS). My Project depends on some native libraries that needs to be existing in the host, and since it is a shared server(with private JVM) I can NOT use SSH to run commands like

sudo apt-get install tesseract-ocr

I only have FTP access. So without these dependent libraries my project just does not work. SO My idea is if I can build/install these libraries on my local machine(Ubuntu or Mac) from source under my usr/local path, Can I just copy these files/folders and put it into my WAR file, will it work?

4
  • too naive to think that .... automated tools that does this kind of stuff like vagrantup.com but you will need all kind of permissions to actually be able to install any of those per-reqiausts. Commented Jun 21, 2015 at 18:07
  • if its just a folder and you want to move it across , then try something like : rsync -rav ~/projects/somefolder/ username@blahblah:/home/someuser/ Commented Jun 21, 2015 at 18:08
  • You are talking about Java code and Java libraries? Commented Jun 24, 2015 at 5:26
  • @Nils java code, C++ libraries bridged with jni Commented Jun 24, 2015 at 7:57

1 Answer 1

2

You may be able to do this. I would try this. First figure out what cent packages you would need. Then go get the rpms from either the 32 bit mirrors or the 64 bit.

Now in Ubuntu make sure you have rpm2cpio and cpio installed. Then for each rpm you downloaded run:

rpm2cpio [libname_something_version_something].rpm | cpio -idmv 

This will unpack a number of files into the current directory. You might need to specify the file locations in order to use them though.

Probably a more effective method would be to ask the administrator to install the libraries for you.

6
  • thank you. Is it possible to create a ".so" file out of it and put it in the war? instead of copying files Commented Jun 23, 2015 at 16:01
  • The advantage of using the rpm that is made for the target machine is that it should be compiled in the form you already need. I thought you said it was a java project which i thought was all .jar files. In any event, if you unpack the rpm it should have the format you need. If it's a C program you will find a library that you can link against. What library are you looking for? That might make it easier for me to help. Commented Jun 23, 2015 at 16:36
  • I am trying to use tesseract-ocr library from my java web project(with wrappers tess4j or javacpp). And it depends many other libraries that I see in requirements list. I somehow need to get them installed in CentOS without rooot access. you can see a related question asked here :stackoverflow.com/questions/30925074/… Commented Jun 23, 2015 at 17:06
  • ok. This is even easier since it's distributed as source you can just build it yourself on the remote machine. Download the tar. Copy it to the target. Untar the files. Follow the build instructions in the README. This will basically just be ./configure && make or something similar. What you won't be able to do is the install part, but that's fine. You will just need to make sure the libraries are reachable. Commented Jun 23, 2015 at 19:06
  • how can I run the "make" comamnd, while I dont have access to commandline and ssh? Commented Jun 23, 2015 at 20:32

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.