B4J Question Run a jRDC2 on a VPS - java file cannot execute

achtrade

Active Member
Licensed User
Longtime User
I'm starting the server with this:

nohup /home/mj/Apps/jre1.8.0_45/bin/java -jar jRDC.jar > nohup.out &

but I'm getting this error:

/home/mj/Apps/jre1.8.0_45/bin/java cannot execute binary file

I double checked that the java file has execute permission and that the file is in that path.

How can I fix this.

Thanks.
 

Attachments

  • java-error.jpg
    java-error.jpg
    39 KB · Views: 274

Ed Brown

Active Member
Licensed User
Longtime User
Try including the path to your jar file as well.

eg. nohup /home/mj/Apps/jre1.8.0_45/bin/java -jar /yourpath/to/the/jar/jRDC.jar > nohup.out &
 
Upvote 0

Ed Brown

Active Member
Licensed User
Longtime User
Is the 'java' exec located in "/home/mj/Apps/jre1.8.0_45/bin" ?
Double check the path to make sure that it's correct.
 
Upvote 0

Ed Brown

Active Member
Licensed User
Longtime User
Hmm, ok try running

uname -a


from the unix command line and post what you get. I suspect that you may be trying to run a 64bit jar on a 32bit system (or maybe even the other way around).
 
Upvote 0

Ed Brown

Active Member
Licensed User
Longtime User
Ok, that's a 64bit system.

Can you now confirm that java is 64bit by running

java -version

from the command prompt.
 
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
I got the error:

-bash: java: command not found

but the file is there
 

Attachments

  • java-error.jpg
    java-error.jpg
    9.8 KB · Views: 261
Upvote 0

Ed Brown

Active Member
Licensed User
Longtime User
if you're in the current directory where 'java' is located then try using the following

./java -version
 
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
if you're in the current directory where 'java' is located then try using the following

./java -version

Yes, I'm in the current directory where java is located but now I got this error when I use ./java -version

-bash: ./java: cannot execute binary file
 
Upvote 0

Ed Brown

Active Member
Licensed User
Longtime User
OK. It might be that the version of Java installed is 32bit OR there just could be something wrong with the install.

Try re-installing Java but make sure that the version being installed is 64bit.
 
Upvote 0

Ed Brown

Active Member
Licensed User
Longtime User
OK, I'm assuming then that the java files were FTP'd to the VPS?

If yes, how did you FTP the files (what application did you use)? Were the files FTP'd in binary mode?
 
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
OK, I'm assuming then that the java files were FTP'd to the VPS?

If yes, how did you FTP the files (what application did you use)? Were the files FTP'd in binary mode?
Yes, I used FileZilla but first I downloaded the file jre-8u162-linux-x64.tar.gz, unzipped it and then uploaded them
 
Upvote 0

Ed Brown

Active Member
Licensed User
Longtime User
Ok.
In Filezilla, make sure that the Transfer Type is set to at least 'Auto' but to ensure that files are transferred correctly you can set it to 'Binary'.
You'll find this option in the menu by following
Transfer -> Transfer type -> then choose the Binary or Auto option.

Failing that, I'd suggest to try installing Java on the VPS instead of a simple copy (I know that Erel is almost always right but... there's always a first time - no offence Erel) :)
 
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
Ok.
In Filezilla, make sure that the Transfer Type is set to at least 'Auto' but to ensure that files are transferred correctly you can set it to 'Binary'.
You'll find this option in the menu by following
Transfer -> Transfer type -> then choose the Binary or Auto option.

Failing that, I'd suggest to try installing Java on the VPS instead of a simple copy (I know that Erel is almost always right but... there's always a first time - no offence Erel) :)


The FileZilla had already set the option "Auto". My RDC is running ok with those java files, I only have problem with this new jRDC2.

Someone has successfully started a jRDC2 on a VPS ?
 
Last edited:
Upvote 0

achtrade

Active Member
Licensed User
Longtime User
Many developers run it on VPS.

How can you run the old RDC if you can't run java -version ? The problem has nothing to do with jRDC2. You are unable to run java itself.

Yes, that's strange. should I install java instead ?
 
Upvote 0
Top