PDA

View Full Version : JAVA and MySQL HowTo with Mandrake



IronBits
11-08-2003, 10:24 AM
By the-mk - edited by IB

Mandrake 9.1 + JAVA + MySQL Connector/J 3.0

Here are the exact instructions, where to download and what to do with it:

Visit http://java.sun.com/j2se/1.4.2/download.html page.
Go to section "Download J2SE v 1.4.2_02",
choose the Download button on "Linux RPM in self-extracting file" in the "SDK"-column.
read the license-agreement if you want to, scroll to the bottom and click "ACCEPT",
download the "j2sdk-1_4_2_02-linux-i586-rpm.bin (about 35 MB),
go to where you downloaded it and
chmod 755 j2sdk-1_4_2_02-linux-i586-rpm.bin
then execute the file ./j2sdk-1_4_2_02-linux-i586-rpm.bin
read the license agreement again and agree with their terms with "yes",
wait while it's unpacking the j2sdk-1_4_2_02-linux-i586.rpm file into current directory,
install the rpm-file with rpm -iv j2sdk-1_4_2_02-linux-i586.rpm , let it work...
Java will be installed to /usr/java/j2sdk1.4.2_02

To add MySQL-support with Java, we need the MySQL Connector/J 3.0:

Visit http://www.mysql.com/downloads/api-jdbc-stable.html page,
choose a compressed Version (*.tar.gz or *.zip, whatever you want) and download it.
Uncompress the file you downloaded with your favorite archiver and search for a file called
"mysql-connector-java-3.0.9-stable-bin.jar", uncompress it and copy this file to the following directory: /usr/java/j2sdk1.4.2_02/jre/lib/ext
or, uncompress and untar it, then cd into the install directory and look for the above .jar file

Now JAVA has been installed, but the disadvantage is that we need to call the java-interpreter
with the whole path (i.e. /usr/java/j2sdk1.4.2_02/bin/java myjavaclassfile).

How to improve this situation:
add the /usr/java/j2sdk1.4.2_02/bin to your PATH-variable
to do that, just create /etc/profile.d/java.sh and insert the following line
PATH=$PATH:/usr/java/j2sdk1.4.2_02/bin
save it, chmod 755 /etc/profile.d/java.sh
now it will be in the $PATH for everyone