How to configure java on freebsd?

I have Java JRE and Java JDK in the FreeBSD 7.2 window (running PFSense) from http://www.freebsdfoundation.org/downloads/java.shtml

find / -name gives me output like: /usr/local/diablo-jre1.6.0/bin/java /usr/local/diablo-jdk1.6.0/bin/java /usr/local/diablo-jdk1.6.0/jre/bin/java 

so I am linking to / usr / local / bin as follows:

  ln /usr/local/diablo-jre1.6.0/bin/java /usr/local/bin/java 

and now i get

 # rehash # java Error: could not find libjava.so Error: could not find Java 2 Runtime Environment. 

SOOOOOO, I wonder if there is any tool you can use to enable a specific Java virtual machine similar to Ubuntus' / etc / JVM?

+4
source share
3 answers

The /usr/local/diablo-jre1.6.0/bin/java application probably finds libjava.so relative to the location of the java application itself. By creating a hard link to java and following it with this hard link, you probably violated this mechanism.

Suggestions:

  • Put /usr/local/diablo-jre1.6.0/bin in your search path.
  • Create an alias for java instead of a link.
  • Replace the hard link with a symbolic link; those. use ln -s to create it.
+3
source

In FreeBSD packages, the script shell must be installed in / usr / local / bin / java, which knows about the different installed JVMs and their JAVA_HOME, etc. Did you accidentally download tarball instead of a package?

What gives pkg_info | grep jdk pkg_info | grep jdk ?

+2
source

If this is in jail, you may need to move / proc temporarily so that it doesn't try to use it to find out where the Java libraries are. This one bit!

0
source

Source: https://habr.com/ru/post/1336893/


All Articles