JAVA_HOME not defined correctly

1.3k views Asked by At

I am attempting to update Jasper Reports Server, and having an issue with Java. It uses Tomcat to run java. I did not install java on this server, and I am not very familiar with java. Java was installed in a folder called /opt/jasperreports-server-cp-5.0.0/apache-tomcat/java/bin/. I do not believe Java was installed correctly, and it is telling me that the JAVA_HOME is not defined correctly.

We cannot execute /opt/jasperreports-server-cp-5.0.0/apache-tomcat/java/bin/java

Java is located in that directory.

I ran the following in a bash shell:

export JAVA_HOME=”/opt/jasperreports-server-cp-5.0.0/apache-tomcat/java”
export PATH=$JAVA_HOME/bin:$PATH

Can you please help me on what I am doing wrong when setting the JAVA_HOME, or does it have something to do with the java folder? should I reinstall Java altogether?

2

There are 2 answers

1
Pierre-Hugues Husson On BEST ANSWER

You say the file /opt/jasperreports-server-cp-5.0.0/apache-tomcat/java/bin/java exists, right ?

Can you execute it ? Can it execute standard jar file ?

6
Anand S Kumar On

Maybe you do not have execute permission for anything inside the $JAVA_HOME path.

You should try using chmod to give execute permission (atleast to bin/java ) , though I would just give to all files. Example -

chmod -R +x /path/to/<folder>/

or for a single file

 chmod +x /path/to/file

also, can you please try the export JAVA_HOME without the double quotes and check -

export JAVA_HOME=/opt/jasperreports-server-cp-5.0.0/apache-tomcat/java