Java package: Difference between revisions

168 bytes added ,  20 December 2013
No edit summary
Line 106: Line 106:
===Make sure that the build environment is configured properly===
===Make sure that the build environment is configured properly===
The installation process requires that the environment variable {{Codeline|JAVA_HOME}} points to the Java Development Kit (JDK) on your computer.
The installation process requires that the environment variable {{Codeline|JAVA_HOME}} points to the Java Development Kit (JDK) on your computer.
*Note that JDK is not equal to JRE (Java Runtime Environment). The JDK home directory contains subdirectories with include, library and executable files which are required to compile the java package. These files are not part of the JRE, so you definitely need the JDK.
*A JDK is only needed when '''installing''' the Java package. For just running Octave with Java, a JRE (Java Runtime Environment) will suffice.
*Note that JDK is not equal to JRE. The JDK home directory contains subdirectories with include, library and executable files which are required to compile the java package. These files are not part of the JRE, so you definitely need the JDK.
*Do not use backslashes but ordinary slashes in the path. Set the environment variable {{Codeline|JAVA_HOME}} according to your local JDK installation. Please adapt the path in the following examples according to the JDK installation on your system. If you are using a Windows system that might be:
*Do not use backslashes but ordinary slashes in the path. Set the environment variable {{Codeline|JAVA_HOME}} according to your local JDK installation. Please adapt the path in the following examples according to the JDK installation on your system. If you are using a Windows system that might be:
:<pre>octave> setenv ("JAVA_HOME", "C:/Program Files/Java/jdk1.6.0_33");</pre>
:<pre>octave> setenv ("JAVA_HOME", "C:/Program Files/Java/jdk1.6.0_33");</pre>
:On Linux systems the location of the Java JDK varies from distro to distro. It could look like:
:On Linux systems the location of the Java JDK varies from distro to distro. The command to set JAVA_HOME could look like:
:<pre>octave> setenv ("JAVA_HOME", "/usr/local/jdk1.6.0_33");</pre>
:<pre>octave> setenv ("JAVA_HOME", "/usr/local/jdk1.6.0_33");</pre>
:or maybe something like (on e.g., Mageia, Fedora and Ubuntu):
:or maybe something like (on e.g., Mageia, Fedora and Ubuntu):
Line 133: Line 134:
:If this returns zero you're OK. If it doesn't return zero (i.e., the command "javac -version" doesn't return normally), the command:
:If this returns zero you're OK. If it doesn't return zero (i.e., the command "javac -version" doesn't return normally), the command:
:<pre>octave> setenv ("PATH", [ getenv("JAVA_HOME"), filesep, "bin", pathsep, getenv("PATH") ])</pre>
:<pre>octave> setenv ("PATH", [ getenv("JAVA_HOME"), filesep, "bin", pathsep, getenv("PATH") ])</pre>
:should do the trick (watch out that 'getenv("PATH")' contains no spaces). Better don't fiddle with the Windows PATH through the Control Panel etc. The above procedure (the same that preinstall.m invokes) only adapts the PATH for the current Octave session and ensures that the Java executables you need are first in the PATH, before any others on your system. Again: provided you've setup JAVA_HOME correctly.
:should do the trick (watch out that 'getenv("JAVA_HOME")' and 'getenv("PATH")' contain no spaces). Better don't fiddle with the Windows PATH through the Control Panel etc. The above procedure (the same that preinstall.m invokes) only adapts the PATH for the current Octave session and ensures that the Java executables you need are first in the PATH, before any others on your system. Again: provided you've setup JAVA_HOME correctly.


===Compile and install the package in Octave===
===Compile and install the package in Octave===
99

edits