Forums

Java fails to run

I need to do local testing of my app with DynamoDB which requires java. When I try and run java, I get the error java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory. Since I don't have root on the system I can't really try and debug the issue. I can't be the first person to run into this, so I'm hoping you have some insight.

Thanks

Sorry, there's not much we can do about that one.

Why not?

We don't support Java I'm afraid...

You made it available on the system though.

Well, the slightly-longer explanation is: we did do some investigations to enable java, and we have an experimental console type ("docker consoles") that will let you run java. but: those consoles have performance issues, and you will only be able to use java in consoles, not web apps or scheduled tasks. So they're of limited use, but I can switch them on for you if you want?

I just wanted to be able to run dynamodb-local during testing: it won't be in support of a web app or scheduled task. If it were possible to run it on here that would be great.

OK -- I've switched your account over to using Docker for consoles, so if you start a new console, Java should work -- but there's no guarantee, as this is still an experimental feature and not officially supported yet. That said, we'd be glad to hear of any error messages you get, as that might be able to help us develop it further and in the future make it an official feature.

Sounds good. Thanks!

Hello, i'm facing the same prob, i'm actually using tika to do some parsing, as its server is in java i'm stuck with "java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory".

Could it be possible to activate this experimental feature to my account too ? Else i'll explore a pure python solution for my parsing problem.

Thanks in advance, Florent

ok. that's active for you now. same caveats before tho!

Hi,

I am also seeing this error: "java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory". Could you please enable docker consoles for my account?

Thanks

okay- any new consoles you start should be docker ones. you can check this by doing a ps in it.

Hello, please can my consoles also be activated because I am having the same issues

okay- any new consoles you start will be docker ones. keep in mind this does not extend to your webapps etc. you can check that you are in a new console by doing a ps in it (docker consoles won't error).

will this also work when we create a virtualenv

will this also work when we create a virtualenv

Yes, Java support is completely independent of which virtualenv you're in.

I need java for running tabula in my app. But it is throwing error as java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

is there any way to solve this problem

Yes. Read the previous messages where the solution is described and the warnings that go with it are detailed and let us know what you want to do.

thanks for your immediate response. please activate docker console for my account if possible. Thank you.

okay- we've enabled that for you

Hi I'm creating a website that needs to compile and test java code and was wondering if I could I get the feature enabled for my account.

Ok. I have enabled docker consoles for your account.

Hey Glenn - could you enable this for me as well? Trying to run tika to parse PDFs.

Sure, that's done now. Just to reiterate the warning, though, it will only work in consoles -- not website code or scheduled tasks.

I am hitting the same error: java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

Would you please enable docker consoles for my account ?

Ok. I have enabled docker consoles for your account.

Thank you! I am hitting this error "Unsupported major.minor version 52.0", you don't support java 8 ?

We have 1.7 installed by default. I can't think of any reason why 8 wouldn't work, but you'd have to install it yourself into your home directory from the official download page.

Thanks a lot for your help! I managed to install java8 in my home directory and it worked! and from my bash I managed to run the java command I wanted.

I really wished I could run the command for my website, but it didn't work, I have my python script running a shell script that is running java command, but it didn't work, anything you could help me with regarding this ?

I am trying to run Stanford Name entity recognition library, and after failing to run the java command from my website, I am trying a different approach that relies on "nltk" package which has Stanford library in it.

The problem is that I am hitting "No module named 'nltk'" error when trying to import "nltk", do you know why this is happening ?

I do appreciate your input for the problem I hitting above! do I need special setup to use nltk from my application ?

See http://help.pythonanywhere.com/pages/InstallingNewModules/

Hi, I also need java for running tabula, could I have the console type ("docker consoles") for me to run java?

Sure! We have enabled docker consoles for your account- any new consoles should be docker ones. You can check that you are in a new console by doing a ps in it (docker consoles won't error).

Hello i also planning to use tabula (java dependencie). Could you help me ?

Thanks in advance!

Sure! I've switched on docker consoles for your account. It's worth noting that this only affects consoles -- Java still won't work in website code or in scheduled tasks.

Hello

If i understen well, i cant use tabulapy as a backend of my webapp ?

That is correct. It will only work in consoles.

hey there, could I please get access to these special docker consoles? I would like to test one thing in java.

Many thanks in advance!

Sure! We have enabled docker consoles for your account- any new consoles should be docker ones. You can check that you are in a new console by doing a ps in it (docker consoles won't error).

thanks a lot!

May I also have it enabled on my account? Thank goodness someone else mentioned tika. For some reason when I use PyPDF2 and print text, the page prints from bottom to top so I'd like to try tika with this docker console..thing. Still don't quite understand it.

OK. I have enabled docker consoles for your account. You will need to start a new console for it to use the new feature.

I need to use tabula-py for my flask web app. Based on comments here it seems like it's not possible. Is it correct?

tabula wouldn't work with your webapp no. It is only possible to run it from an interactive console if we enable the docker consoles for you.

Hi, I am also seeing this error: "java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory". Could you please enable docker consoles for my account please? Thanks

Ok. I have enable docker consoles for your account.

I also want Docker Consoles on my account.

Ok. I have enabled docker consoles for your account.

Hi Glenn,

Can I have docker consoles on my account too. Trying out tika as well. Thanks a lot!

Ben

Hi Ben -- no problem, that's done now. Any new consoles you start will use Docker.

Hi - Can you provide a docker also? I will need to run the Tabula library

Sure, any new consoles you start will use Docker.

from nltk.parse.stanford import StanfordDependencyParser dependency_parser = StanfordDependencyParser(path_to_jar=path_to_jar, path_to_models_jar=path_to_models_jar)

raise OSError('Java command failed : ' + str(cmd)) OSError: Java command failed : ['/usr/bin/java', '-mx1000m', '-cp', '/home/xxx/mysite/stanford/stanford-parser-3.9.1-models.jar:/home/xxx/mysite/stanford/stanford-parser.jar:/home/xxx/mysite/stanford/stanford-parser-3.9.1-models.jar', 'edu.stanford.nlp.parser.lexparser.LexicalizedParser', '-model', 'edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz', '-sentences', 'newline', '-outputFormat', 'conll2007', '-encoding', 'utf8', '/tmp/tmpxbyb5fdn']

How can I fix the error. I really need the Stanford parser works on my web app. Otherwise, I have to say good bye to Pythonanywhere

Unfortunately the Java stuff won't work on the web app, it will only work from the console. Sorry about that :(

Should we make a help page about docker consoles?

Probably not -- here's why:

The specific thing that Java needs to run is a /proc/ filesystem; it uses this to get information about the system's running processes (precisely why it needs to do that I don't know).

Docker consoles provide this, but our normal virtualization system does not. However, changing that is high on our priority list, as other programs (in particular recent versions of Firefox, and all Webkit-based browsers like Chrome and PhantomJS) also need it.

When we've added /proc to our normal virtualization system, we'll probably switch off Docker consoles as an option because they won't provide anything that non-Docker consoles don't have -- and they're much more resource-intensive.

So it's probably not work giving detailed documentation for something that's going to change pretty soon.

Just a question, Docker console are for paid account?? how do we active them. Google My Business API look like to be Java only, I am fighting to learn this language fast. I love so much Python, and Java is looking like an really strict and formatted language. with a 90 years design.

They don't require a paid account. You have to ask staff to turn them on for you. In an upcoming update (coming very soon), you won't need Docker consoles because the normal virtualization will support Java.

There was an email saying that there will be a system update this Thursday.

I am so into actuality, Ok Thanks Dull for the Update.

Just to set expectations on this -- the system update introduced the new virtualization system as a per-user option, but we'll be introducing it gradually just to make sure it doesn't break stuff. So right now we have it switched on for our own accounts as an internal beta test, and if all is well we'll start rolling it out more broadly over the coming weeks. Let us know if you'd like to be an early adopter :-)

I need Neo4j server to run in a virtualenv as I hope to access its graph database via the bolt or http protocols in my python app. In order for that to happen I need Java 8 to run. When I try and run java, I get the error java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory.

Are these new beta virtualenv java enabled? Would Neo4j server be able to run in this special console / virtualenv and service requests (bolt or http) ?

Please let me know how can I test this beta java enabled virtualenv

I want to beta test the new virtualization system

Thanks for letting us know that you're interested! We've done basic tests on Java under the new virtualisation system -- running a "hello, world" program and so on -- so we're reasonably sure it works. The package that is installed is the Ubuntu openjdk-8-jre:amd64 one, so that should be good.

However, a Java server would not work right away -- the only kind of servers we support right now are Python web server based on the WSGI protocol. We are planning to support generic servers later on, at least for internal use (that is, they'll be accessible from code running inside PythonAnywhere, but not from outside). We may also at a later stage support general HTTP/HTTPS servers that are accessible from outside PythonAnywhere.

Can you please let me know if my account has this new (beta) capability ? Once it's on, this virtualenv will be supported by openjdk-8-jre:amd64 ?

No, it currently does not. Although we have the feature out live, we have currently only turned it on internally. We will reach out when we have tested it for a bit longer to people interested in trying it.

Please add me to the list of eager beta users. Looking fwd to it. Thanks

Sure! I've added you to the list. I'll reiterate, though, that you won't be able to run a Java server with it.

Our new virtualization system is now ready for beta-testing :-) If you'd like us to switch it on for your account, please log in then use the "Send feedback" link at the top of the page to send us a message requesting that we do so.

With the new virtualization system, consoles fail to start very often

In what way are they failing?

When I start a new console, they often get the "Sorry your console process failed to start..." error

This happens about half the time

That's odd. Could you try to start one, and then if it fails, send us the URL of the console over the "Send feedback" system so that we can take a look at what happened?

I had both docker consoles and the new virtualization system enabled. Just wanted everyone to know this strange thing

wow these consoles run so much faster now

That's good to hear :-)

Hi, Can I please have this new virtualisation system enabled for my account as well. I desperately need to run tabula in my web app too. Thanks

Ok, that's done for you.

Thank you I appreciate it! Looks like you have made java available for my existing virtual environment, so I did not have to create my venv from scratch using the new virtualization system?. I did not have to do anything it worked straightaway, great service thanks once more.

Yes, you do not need to rebuild anything. It's separate from system image change.

Awesome! Thanks

Hi there ! I am trying to use Tika to parse some PDF files, but I get initialization error messages. Maybe I also need some advanced option enabled on my profile ?

Could you post the exact error messages that you're getting?

Hi Giles, and sorry for this late answer. Here's the error message I get :

2020-03-18 14:31:33,154 [MainThread ] [WARNI] Failed to see startup log message; retrying...

2020-03-18 14:31:38,178 [MainThread ] [WARNI] Failed to see startup log message; retrying...

FYI, when I start my script on my local machine (Jupyter Notebook), I have this exception raised : 2020-03-18 15:55:14,058 [MainThread ] [INFO ] Retrieving http://search.maven.org/remotecontent?filepath=org/apache/tika/tika-server/1.23/tika-server-1.23.jar to /var/folders/q2/96vc_wy10jzg9pcq74fj4hfw0000gn/T/tika-server.jar. 2020-03-18 15:55:17,352 [MainThread ] [INFO ] Retrieving http://search.maven.org/remotecontent?filepath=org/apache/tika/tika-server/1.23/tika-server-1.23.jar.md5 to /var/folders/q2/96vc_wy10jzg9pcq74fj4hfw0000gn/T/tika-server.jar.md5. 2020-03-18 15:55:17,975 [MainThread ] [WARNI] Failed to see startup log message; retrying...

But after a few seconds, everything works fine.

@Contexte: Yes, you do need the new virtualisation system enabled for your account. I have enabled it for you. Be aware, however, that it is still experimental and we have not yet implemented it for notebooks. So tika should start to work in new consoles, but will not work in notebooks.

Thanks !

Hello, I'm trying to run some Java code from bash. Would you be so kind and enable the new virtualization feature for my account please?

No problem. I have enabled it for your account.

Thanks a lot man.

Hello, would you be so kind and enable the new virtualization feature for my account please?

Sure, no problem -- that's done now, and will be used in any new consoles that you start.

Hi Giles, Could you please enable for me as well? I would like to run java

No problem. It's done for you.

HI Giles, my work with Java is done. Can you kindly turn it back?

Sure, no problem! That's done.

Hello Giles, please could you help me enable Java. Thanks

@crackerbox -- no problem, that's done now. It should work in any new consoles you start; websites and scheduled/always-on tasks will pick it up the next time they're restarted.

Hello @giles ,could you please help to enable Java for my account?

P.S.Is it allowed to develop Java programs on PA?

Sure, no problem -- that's done now. Like the system image update that we just did, it should work in any new consoles you start; websites and scheduled/always-on tasks will pick it up the next time they're restarted. And yes, you're quite welcome to develop Java programs on our site!

Hello. I try to use https://pypi.org/project/tika/ (Apache Tike). It is Java based. I got RuntimeError("Unable to start Tika server."). It seems that Java support is not switched on. Can you help please? Thanks.

No problem. It's enabled for you now.

Hi there. Could you enable the docker console for my account? Thank you so much.

I've switched on our new virtualization system for your account -- it's like Docker consoles (which we no longer support) in that it will support Java, but it's better because it works not only in consoles, but in websites, scheduled tasks and always-on tasks. It will be used in any new consoles you start; websites and scheduled/always-on tasks will pick it up the next time they're restarted.

ok thank you

No problem!

Hello! Can you switch on java on my account too please? Thanks.

Sure, that's done now. It will be enabled in any new consoles you start; websites and scheduled/always-on tasks will pick it up the next time they're restarted.

Thank you!

I'm having trouble running a Java command from my Python script. It returns:

ERROR: JAVA_HOME is set to an invalid directory: /usr/lib/jvm/java-7-openjdk-amd64

When I run readlink -f $(which java) I get:

/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

Also, java -version returns

java: error while loading shared libraries: libjli.so: cannot open shared object file: No such file or directory

Is all of this a matter of what was mentioned in this thread before? If so, could you please enable Java for me too?

Java requires new experimental virtualization feature to be enabled on PythonAnywhere. I've just enabled that for you.

@pafk Perfect, thanks!

Edit: Still got the first error, but that was fixed after running this:

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

I would like to use java as well, can you please turn it on for me? Thanks

Our beta virtualization feature is enabled for you as well.

Can you switch on java on my account too, please? Thanks.

Sure, no problem -- that's done now.

Good morning, I would like to run Java on a console, so I can run JAR files in the background. How would I go about doing this. Thanks in advance, -PlasmodiumFalc

Good morning, I would like to run Java on a console, so I can run JAR files in the background. How would I go about doing this. Thanks in advance, -PlasmodiumFalc

I see you asked about this on another thread so I'll answer there.

I would like to use Java as well, can you please turn it on for me? Thank you very much!

sure, we have turned that on for you.

Hi, Pythonanywhere team, I'm interested in trying the experimental virtualization to be switched on on my account too, thanks in advance! -米卡太阳。

@TaiYangMedical It's done for you

Hello, I need to use Java as well. Could you please turn it on for me? Thank you very much :)

@yichunren It's done for you

I'm interested in the new virtualization system -- could you please enable it for me? Thanks!

We are doing the activations in batches at the moment. I have added you to the list for the next batch, which should be sometime next week.

@ggenellina it's done for you

Please enable java 9 for me

We only have Java 8 installed right now, but that is already available for your account.

Hello, I need to use Java as well. Please turn it on for me regards..

It is already turned on for your account.

Hello, I need to use Java as well. Please turn it on for me. Thank you very much!

It is already turned on for your account.

Hi - Can you provide a docker also? I will need to run the Tabula library

We do not provide docker and we do not plan to.

Hello, I need to use Java . Please turn it on for me. Thank you very much!

It is already enabled for all accounts.

Hi there.

Will I be able use libraries such as tabula-py (https://pypi.org/project/tabula-py/) that needs Java in a Django Web App?

Thanks.

tabula-java is not installed on PythonAnywhere, so I don't think that it could work.