4

I have some space with bluehost and would like to run a java program that I wrote from it.

The problem is I don't think bluehost supports java. When I ssh in and then type javac -v I get command not found.

Is there anyway to export a java file into something that isn't a .jar that I could run this java program on the bluehost server?

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
Chase Roberts
  • 9,082
  • 13
  • 73
  • 131
  • If the host does not support Java it is an uphill battle. Perhaps signing up for Google Application Engine may be simpler? – Thorbjørn Ravn Andersen Aug 03 '13 at 19:10
  • If you a shell account for bluehost, why don't you just download java binaries and put them in your home directory, export JAVA_HOME and add JAVA_HOME/bin to your path? – Mike K. Aug 03 '13 at 19:11
  • I downloaded a jdk binary and export JAVA_HOME and added JAVA_HOME/bin to the path and am still getting "Exception in thread "main" java.lang.ClassFormatError: Main (unrecognized class file version)". & when I run java -version I am getting 1.5.0 when I just added 1.7.***. Maybe I did have java before but not the java compiler. – Chase Roberts Aug 03 '13 at 20:56
  • @ChaseRoberts did you ever figure it out? – SimaPro Sep 11 '13 at 02:23
  • No, I gave up and just run it everyday manually from my local machine. – Chase Roberts Sep 11 '13 at 22:57
  • In my cron entries I type out the full path to the local Java binaries I downloaded to my Bluehost home. (/home2/myhome/java7/bin/java, for example). – jdusbabek Sep 21 '16 at 17:14

1 Answers1

4

If you want to run a java program on your bluehost server you have a few options.

Option 1. Get dedicated hosting, which probably costs way more, then you can get sudo access and you can sudo yum install java.

If you have dedicated bluehost hosting then:

Login to your Bluehost Control Panel
Click the Server quicklink
Scroll down to the Access Management section.
Click the Primary User tab.
Enable sudo

Option 2. Download java jdk in your local sandbox and install locally.

a.  From bluehost terminal run command `uname -m`  mine says 64 bit.
b.  Go download the 64 bit linux JDK .tar.gz
c.  untar it and install it to somewhere local.
d.  Add an alias so that javac and java are reachable from terminal.

Option 3. Make your own server or virtual machine.

Eric Leschinski
  • 146,994
  • 96
  • 417
  • 335
  • I tried option 2, but when running 'javac' I get this: Error occurred during initialization of VM java.lang.OutOfMemoryError: unable to create new native thread - is there a way around this on Bluehost? – Oleg Feb 23 '18 at 22:08