LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   java (https://www.linuxquestions.org/questions/linux-newbie-8/java-686470/)

Pieter le Roux 11-26-2008 04:40 PM

java
 
Hi, I'd be glad if you can help me. I can't seem to install java correctly. I want to work on a forex trading program (web based platform) as the normal trading program doesn't want to install at all.

jay73 11-26-2008 05:12 PM

Which distribution? Ubuntu, Fedora, Suse, Mandriva, Debian, ...?

Pieter le Roux 11-27-2008 05:21 AM

Hey I'm as lost never before, downloaded it from SUN at this page: http://java.com/en/download/linux_ma...&host=java.com

I tried to copy it into /usr/local but copy and paste doesn't work as there isn't a paste option when I right click in that folder. I also can't seem to download it directly into that folder.

jay73 11-27-2008 05:58 AM

Well no, all system directories are protected from regular users. They can be accessed only by super users, who have to log in as root first. This involves a bit of command line work but most distributions now come with plug-ins that will let you open protected folders/files by simply selecting an option from the context menu. Packages (like the jdk) can be installed and managed a lot more easily than what you are trying to do if you use the system package manager, which will take care of the download and install for you. Unfortunately, I cannot offer any further details as long as I do not know which distribution you are using.

Pieter le Roux 11-27-2008 09:10 AM

I'm clueless... how can I check?

jay73 11-27-2008 09:21 AM

Try the following commands in a terminal:
cat /etc/issue
or
cat /etc/release

By the way, have you got an administrator account/password? If not, you will have to install the software in your home directory.

Pieter le Roux 11-27-2008 04:46 PM

Debian GNU/Linux 4.0 \n \l

jay73 11-27-2008 07:47 PM

You can find out which jdk is available by running this command in your terminal:
aptitude search jdk
I believe that the highest Debian 4.0 has to offer is sun-java5-jdk, which is the 1.5.?. version of the sun JDK. If you have an administrator password, you can install it with:
su -
(enter root password)
aptitude install sun-java5-jdk
exit
That is all you need to do.

However, without such a password, you are limited to installing a JDK manually to your home directory. This also means you will have to put up with the inconvenience of configuring things manually (and even then, integration with the system will not be optimal).
Visit sun and get the .bin version of the JDK (the latest stable release is 1.6.10 or so). Extract it by running
chmod +x name_of_downloaded_package
./name_of_downloaded package
Now you need to inform the system that a JDK has been installed. Open your .bash_profile
(if you have gedit, you can run gedit .bash_profile) and add this at the bottom:
export JAVA_HOME=$HOME/name_of_extracted_jdk_directory (should be something like jdk_1.6.10)
export J2RE_HOME=$JAVA_HOME/jre
export JAVA_BIN=$JAVA_HOME/bin
export CLASSPATH=$CLASSPATH:$JAVA_HOME:$JAVA_HOME/lib
export PATH=$JAVA_BIN:$PATH
Save, log out and log in again. Check by running the following commands in your terminal:
echo $JAVA_HOME <- this should point to point to your jdk directory
java -version <- this should show the version of the jdk that you installed

Next, you can install an IDE such as Netbeans or Eclipse.

Pieter le Roux 11-28-2008 09:17 AM

I have an admin password, but nothing happens when I run aptitude search jdk.

I tried to download a sun-java5-jdk file and then run your commands again but this is what happened:
/home/user/My Documents> su -
Password:
eeepc-pieterler:/root> aptitude install sun-java5-jdk_1.5.0-14-letch1_i386.deb
Reading package lists... Done
Building dependency tree... Done
Initializing package states... Done
Reading task descriptions... Done
Building tag database... Done
Couldn't find any package whose name or description matched "sun-java5-jdk_1.5.0-14-letch1_i386.deb"
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.

jay73 11-28-2008 10:30 AM

Oh, you have an eeepc! You should have mentioned that.
For one thing, because the eeepc does not have Debian as an operating system but Xandros (which is based on Debian). For another thing, because ASUS seems to have decided that it would be a great idea to rip out the package manager. The consequence is that, as you have discovered, aptitude will not work.
To enable as much functionality as possible, I would recommend that you have a look at this:
http://www.r3uk.co.uk/index.php/home...ips-and-tricks

As for installing the jdk package manually, that does not involve any aptitude. Aptitude (or alternatively apt-get) is used to fetch software packages from the on-line software collection for your operating system. If you install things manuallly, then you just need to extract them. If you have a look at my previous post, you will see that I explained it all, from download up to and including configuration.

I would still recommend installing the package through aptitude (or apt-get) over installing manually. You may want to take the alternative approach if you find that Xandros does not offer any JDK. And if you feel more experimental, you could even consider installing a completely different operating system; there are quite a few alternatives that are 100% free, perfectly reliable and a lot more flexible than Xandros.

Pieter le Roux 12-03-2008 08:22 AM

I'm getting tired of this operating system. I ran all the commands a few times now but nothing seems to work. I copied and pasted all the commands except this one:
/home/user> chmod +x jdk-6u10-linux-i586.bin
/home/user>

Did I type something wrong? jdk-6u10-linux-i586.bin is the file I downloaded from Sun.

jay73 12-03-2008 09:04 AM

Nothing wrong with the chmod command as you posted it. After doing so, you just need to run
./jdk-6u10-linux-i586.bin
(you can just type jdk and then press TAB for auto-completion - providing that the jdk has not been extracted yet during one of your previous attempts, in which case you can skip immediately to the .gedit part).
You will need to accept the license by typing "y", then the jdk directory will be extracted to your home directory.

Then all you need to do is open your .bash_profile (or .profile if Xandros does not use .bash_profile):
gedit .bash_profile (or gedit .profile)
and paste all this at the bottom (do not forget to do the name_of_etc edit):
Quote:

export JAVA_HOME=/home/user/name_of_extracted_jdk_directory <--- replace "name_etc" with actual name of extracted jdk directory, probably "jdk1.6.10"!!!
export J2RE_HOME=$JAVA_HOME/jre
export JAVA_BIN=$JAVA_HOME/bin
export CLASSPATH=$CLASSPATH:$JAVA_HOME:$JAVA_HOME/lib
export PATH=$JAVA_BIN:$PATH
Save, log out and log in.

Now check by entering these into your terminal:
echo $JAVA_HOME
and
java -version

If that does not do it, then yes, I would also get tired of Xandros very soon.

Pieter le Roux 12-03-2008 05:20 PM

I did, it still doesn't work. wich operating systems were you referring to?

/home/user> ./jdk-6u10-linux-i586.bin
./jdk-6u10-linux-i586.bin: line 1: syntax error near unexpected token `<'
./jdk-6u10-linux-i586.bin: line 1: `<HTML><HEAD><TITLE>Error</TITLE></HEAD><BODY>'
/home/user>

jay73 12-03-2008 06:39 PM

Those are some really weird error messages, it looks as if the jdk file you downloaded is an html file???

Well, it appears you can get the package manager (synaptic) if you enable full desktop mode; once you have synaptic, you can install the jdk with a few clicks:
http://www.downloadsquad.com/2007/11...urse-in-linux/

As for the other operating systems I was referring to, here is one very popular one:
http://www.eeebuntu.org/ (see download section for details)
Plenty more here (even explains how to install windows if that is what you prefer):
http://wiki.eeeuser.com/#installing_operating_systems


All times are GMT -5. The time now is 05:38 PM.