Forums

How to install Java ?

Hi,

Am trying to install Java,

1) I tried "pip install java" command

Following was the error I received:-

Downloading/unpacking java Could not find any downloads that satisfy the requirement java No distributions at all found for java Storing complete log in /home/ulmastersproject/.pip/pip.log

2) I tried using "apt-get install java" command

Following was the error I received:-

bash: apt-get: command not found

3) I unpacked jre tar file from http://www.java.com/en/download/help/linux_x64_install.xml

But am still not able to install java,

Kindly help to install java, appreciate your suggestions / help.

Thanks, San

We don't support Java and we have no plans to. What is it that you're trying to accomplish with it?

Am trying to install Jython !

Hmm, that sounds like something we should take a look at, then. I'll add it to our list.

Thanks Giles, let me know once you have added it !

I should say, it might take a while. We'll need to make sure that all of the Java dependencies are installed in our default image, which could be fiddle.

Two thoughts on original post...

Jython is intended to add python support to a java-based infrastructure, as far as I know... why would you want to install jython in an environment where actual python is the primary technology?

Building on that, if java support is ever added, could PythonAnywhere also support solr? Frankly, just solr support (as an alternative to open-install-any-java-thing support) would probably be more widely useful to the service (since adding non-google search still seems to be non-trivial) than Jython, which is a kinda-sorta-not-quite-entirely-python implementation.

(not knocking jython - just saying I think of jython as a way to run python when you can't have python (i.e. in a java-tomcat-war-only environment)

Since my website users are Java developers, am planning to provide them an infrastructure where they can write Jython and get the executables delivered. Which then they will integrate them into their Java based Apps.

Thanks, San

@hanleybrand right, solr would definitely be useful -- in fact, when I upvoted Java on our to-do list on ulmastersproject's behalf, if looks like over half the previous times people have asked for Java it's been so that they could use solr.

I want to use Cassandra which runs in Java, so having Java 6 would definitely help!

No offence to Java enthusiasts, but Java seems to have a scary security track record when connected to a web browser. Perhaps there is something in this discussion that inherently nullifies that concern, but if not, I'd really hate to see our environment plagued with security problems.

Could be wrong here, I think the big problem with Java security is when it's installed in the browser to serve up applets, or when it's installed on client machines generally. I don't know of any particular issues with Java running on the server.

If I'm wrong on that, I'd love to know!

Isn't that just the issue though? Maybe I'm missing something, but PA isn't really either a server or a client. It's role depends on what someone is doing at the time. If someone can browse out from PA's FF for some web scraping and the Java client ends up loaded in that FF environment, then PA is now at risk of every one of those Java client issues...

Fair point. I think we'd install Java for server processes only.

Hi all. I have a pretty concrete use case where I need to be able to run Java - basically, I need to be able to shell out and run a java-based command line program from within a python flask app. The command line program has to be java because I'm leaning on a particular open source program to do the heavy lifting - there is sadly no other efficient way to do it.

I'm running jdk 1.6.0 FWIW.

Is this possible?

@sozin. Not yet, but we'll try and get java installed next time we do a server image build. that may be weeks/months away tho.

In the meantime, what's the tool you're trying to use? If it's search, maybe one of the pure-python tools could work as a prototype?

It is extremely specific. I'm cracking open saved game files from the popular open source Vassal ( http://www.vassalengine.org/ ) program, stripping out some information, and then writing down a new file. To do that I'm using the Vassal jars/source code. So there's no other good way to do it other than Java, since that is the program Vassal is written in and the only libraries available for packing/unpacking/munging their proprietary (and pseudo-encrypted) file formats.

well, that is specific! sorry we can't be of more use...

no prob. will watch this thread for when Java becomes available from the console. thank you!

Well, it's been a while, but Java is now installed. We've done some basic tests but it's possible stuff is missing -- let us know if you have any issues!

Ah, I should note that it's only available in our new-style Docker consoles -- not for old consoles or for web apps or scheduled tasks. Let us know if you'd like us to switch on Docker consoles for your account.

awesome! thank you! will give it a spin.

@permalink i want to get solr installed. How do i go about this?

I believe that solr requires a Java web-serving infrastructure to run, so it won't work on PythonAnywhere.