LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-23-2005, 06:14 PM   #1
barabus
Member
 
Registered: May 2005
Distribution: SUSE LINUX PRO 9.3
Posts: 57

Rep: Reputation: 15
java .rpm chmod command not working!


Hi Folks.

I wonder if anyone can shed any light on this problem.

I downloaded the Java JRE 1_5_0_03-linux-i586-rpm.bin file from the Sun site and as they suggested tried to extract the rpm from it by running:

Code:
chmod a+x jre-1_5_0_03-linux-i586-rpm.bin ./jre-1_5_0_03-linux-i586-rpm.bin
First off, this routine did try to open the licence agreement file but the result was what seemed like a hierogliphic in the command window with an inability to scroll to the accept button - basically the licence agreement crashed KConsole.

After several repeated attempts to run the same command nothing happened, so I binned the original bin file and downloaded another - repeated the procedure and still nothing.

I simply cannot get chmod a+x to unpack this binary and therefore cannot extrac the rpm and install java. Anyone know why this is happening and more to the point how I can fix the problem.

Thanks in advance

- Barabus
 
Old 05-23-2005, 06:54 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
It looks like you've given bash a confusing command. Chmod a+x <filename> should be seperated from ./<filename> by a semi-colon, to tell bash that chmod acts on the first instance of the filename, then execute the filename. Otherwise, the second instance of the filename looks like an argument to chmod, which confused bash.

Otherwise, you could try just renaming the file (without the .bin) and try to use rpm on it. It' rare, but it does occaisionally happen, that a file acquires an extension which doesn't belong. Just removing the extension is all it takes to fix the problem.
 
Old 05-23-2005, 08:30 PM   #3
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
RPM probably won't install itbecause whilst its not yet extracted, its technically speacking not an rpm. The right way to have extracted and installed the file is as follows,
Code:
$chmod +x jre-1_5_0_03-linux-i586-rpm.bin 
$./jre-1_5_0_03-linux-i586-rpm.bin
$su
#rpm -Uvh jdk-1_5_0_03-linux-i586.rpm
 
Old 05-24-2005, 09:12 AM   #4
barabus
Member
 
Registered: May 2005
Distribution: SUSE LINUX PRO 9.3
Posts: 57

Original Poster
Rep: Reputation: 15
Thank you both for the replies. Re. bigrigdriver - removing the extension did not do the trick alas.

I logged out of the user session completely and logged into the root. I then located the download and cut it and pasted it to desktop in root. from there logged in as su I ran the commands as su (as described by reddazz and by sun). This time it worked.

This is the same procedure I had tried several times when logged in as user and even then exactly as described by redazz - but it didn't work.

I was eventually left with 2 versions of jre - one in /etc/alternatives and the new one in /usr/java/

I tried to configure the java.con file in /etc/java/ to point to the new one as suggested in the readme file but no matter what I tried I kept getting the earlier version when typing java -version into a command line.

I eventually replaced the contents of the jre1.4.2 folder in /etc/alternatives with the 1.5.0.03 version and renamed the folder accordingly. I also renamed the jre exports folder. This seems to have done the trick.

I had tried previously to install the rpm by usin YaST but this throws up a lot of problems such as conflict between existing versions of Java which in turn forces you to downgrade Open Office and uninstall the earlier version of java - and yet still does not install the new verson to the default folder. This is both confusing and time consuming.

All that said I hope all is well with what I have done and that dependencies will function correctly as I'm at a loss how to figure out the .conf file.

Thanks again for te replies folks!!!
 
Old 05-24-2005, 09:41 AM   #5
PerfectReign
Member
 
Registered: Apr 2005
Location: Los Angeles
Distribution: openSUSE / Ubuntu
Posts: 294

Rep: Reputation: 33
Um, as for copying the files into the folder, that wasn't necessary. (But probably not a bad idea...)

Unfortunately, getting the latest and greatest JDK/JRE through YaST is almost impossibe.

There's a file /etc/profile that contains all environment variables such as path. What I originally did (after backing up the file) is edit the path to point to the new JDK directory. Like you experienced, this caused confusion with YaST and OOo.
I was getting all sorts of errors with OOo and Java.

I then decided that leaving the original 1.4.2 JDK would be okay if I could still get to 1.5.0. Since a path statement will use the first library it finds, I prepended my local path (since I'm the only user other than root) to include the latest/greatest before version 1.4.2 was found. This method satisfied both me and YaST. This was done in a file called profile.local which is in the /etc directory. (I found this on alt.os.linux.suse, by the way.) I then created a text file called /etc/profile.local and added the folloiwng entries:

Code:
# /etc/profile.local

# Java environment
# Sun JVM
JAVA_HOME=/usr/local/jdk1.5.0_03
export JAVA_HOME

#
# later on I have
#
# Modify Path
PATH=$JAVA_HOME/bin:$PATH
export PATH
What this does is leave my root "path" intact and allows my local profile to see the 5.0 JDK prior to the 1.4.2 installed by YaST.

I also am using Cloudbase/Derby as a local database (for a Java class) so I needed the CLASSPATH set. Since I have the file installed on my Windows D: drive I just added the following to my profile.local file.

Code:
#Derby Path
CLASSPATH=./:/windows/d/projects/cs/lib/derby.jar:/windows/d/projects/cs/lib/derbytools.jar
export CLASSPATH
HTH!!
 
Old 05-24-2005, 07:18 PM   #6
barabus
Member
 
Registered: May 2005
Distribution: SUSE LINUX PRO 9.3
Posts: 57

Original Poster
Rep: Reputation: 15
PerfectReign,

Thanks (even after the fact) for this - I will guard the inf for future releases. just on another note you mention a binary where you got the info. Seems my Cable operator does not provide a news server.

Any idea how I can access one (maybe a free one even) as it seems like a real hassle these days that all the best info is posted on binaries and not everyone can access them.

Thanks for sharing this info once again, without access to binaries etc this is useful info to have.
 
Old 06-05-2005, 10:26 PM   #7
tmking
LQ Newbie
 
Registered: Jun 2005
Distribution: fedora core 2
Posts: 3

Rep: Reputation: 0
uname -a:
Linux coltrane 2.6.10-1.770_FC2 #1 Sat Feb 26 21:40:22 EST 2005 i686 i686 i386 GNU/Linux



I also just downloaded jre-1_5_0_03-linux-i586-rpm.bin (BitTorrent rules!)
I did not previously have Jave Runtime Environment installed on this particular computer.

I did the following:
chmod +x jre-1_5_0_03-linux-i586-rpm.bin
./jre-1_5_0_03-linux-i586-rpm.bin

That is to say, I made the bin file executable and executed it through a bash prompt. I read (yeah, right) the license agreement and typed "yes" when prompted. It extracted the rpm AND installed the file on it's own. It seems to be working just fine. Hope this helps someone.
 
Old 06-05-2005, 10:42 PM   #8
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
It extracted the rpm AND installed the file on it's own. It seems to be working just fine. Hope this helps someone.
Running ./jre-1_5_0_03-linux-i586-rpm.bin will only extract an rpm from the bin file, it does not automatically install it.
 
Old 06-05-2005, 11:01 PM   #9
tmking
LQ Newbie
 
Registered: Jun 2005
Distribution: fedora core 2
Posts: 3

Rep: Reputation: 0
I don't know about you, but when I ran the file, it did. I got the nice little "Preparing..." and the hash marks one would see when running "rpm -ivh". I did not have to "rpm -ivh" myself, the bin file did it. I just sat back and watched it do it's thing.
 
Old 06-06-2005, 12:41 AM   #10
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Don't you mean the hash marks hat you see when the rpm is being extracted from the bin file? The bin file does not automatically install the extracted rpm, you have to do that as root. To check if indeed the rpm has been installed, run
Code:
$rpm -qa | grep -i jdk
If nothing is returned then java is not installed. Personally I don't think it is if you did not manually install the rpm.
 
Old 06-06-2005, 01:21 AM   #11
tmking
LQ Newbie
 
Registered: Jun 2005
Distribution: fedora core 2
Posts: 3

Rep: Reputation: 0
That's not what I mean at all. I mean the hash marks you see when you type something like:

Code:
rpm -ivh mplayer-1.0pre5-2.i386.rpm
More specifically, this is EXACTLY what I did.

Code:
[root@host root]# ./jre-1_5_0_03-linux-i586-rpm.bin
Sun Microsystems, Inc. Binary Code License Agreement

for the JAVA 2 PLATFORM STANDARD EDITION RUNTIME ENVIRONMENT 5.0

SUN MICROSYSTEMS, INC. ("SUN") IS WILLING TO LICENSE THE SOFTWARE
IDENTIFIED BELOW TO YOU ONLY UPON THE CONDITION THAT YOU ACCEPT
ALL OF THE TERMS CONTAINED IN THIS BINARY CODE LICENSE AGREEMENT AND
SUPPLEMENTAL LICENSE TERMS (COLLECTIVELY "AGREEMENT"). PLEASE READ THE
AGREEMENT CAREFULLY. BY DOWNLOADING OR INSTALLING THIS SOFTWARE, YOU
ACCEPT THE TERMS OF THE AGREEMENT. INDICATE ACCEPTANCE BY SELECTING THE
"ACCEPT" BUTTON AT THE BOTTOM OF THE AGREEMENT. IF YOU ARE NOT WILLING
TO BE BOUND BY ALL THE TERMS, SELECT THE "DECLINE" BUTTON AT THE BOTTOM
OF THE AGREEMENT AND THE DOWNLOAD OR INSTALL PROCESS WILL NOT CONTINUE.

...

(license agreement stuff)

...

E. Third Party Code. Additional copyright notices and license
terms applicable to portions of the Software are set forth in
the THIRDPARTYLICENSEREADME.txt file. In addition to any terms and
conditions of any third party opensource/freeware license identified
in the THIRDPARTYLICENSEREADME.txt file, the disclaimer of warranty
and limitation of liability provisions in paragraphs 5 and 6 of the
Binary Code License Agreement shall apply to all Software in this
distribution.

For inquiries please contact: Sun Microsystems, Inc., 4150 Network
Circle, Santa Clara, California 95054, U.S.A.  (LFI#141623/Form
ID#011801)

Do you agree to the above license terms? [yes or no]
yes
Unpacking...
Checksumming...
0
0
Extracting...
UnZipSFX 5.42 of 14 January 2001, by Info-ZIP (Zip-Bugs@lists.wku.edu).
  inflating: jre-1_5_0_03-linux-i586.rpm
Preparing...                ########################################### [100%]
   1:jre                    ########################################### [100%]

Done.
Notice that the ONLY bash command that I issued was:

Code:
[root@host root]# ./jre-1_5_0_03-linux-i586-rpm.bin
Thats it. Nothing else. Nothing.

The only other interaction I had with the computer was typing "yes" to agree to "the above license". IMHO, you should try
Code:
$rpm -qa | grep jre
rather than
Code:
$rpm -qa | grep jdk
. Notice that the file we are talking about is "jre-1_5_0_03-linux-i586-rpm.bin" and the rpm is "jre-1_5_0_03-linux-i586.rpm". Both of these start with "jre" (Java Runtime Environment), not "jdk" (or Java Developer's Kit). I'm not much of a professional, but from the experience I've had with Linux and my natural aptitude for common-sense, I would have thought that an rpm begining with "jre" would install under the letters "jre", not "jdk". Therefore, if I wanted to find out if that rpm was installed, I would look for "jre", not "jdk".

After I executed the bin file and it installed itself, I did an "ls" and lo and behold, I found this file.

Code:
jre-1_5_0_03-linux-i586.rpm
You are right that the bin file extracts the rpm. It ALSO installs it. Frankly, I would have hoped that the folks over at Sun could manage to do it all in one step, since one would only be extracting the rpm in order to install it.

And FYI, I downloaded the bin file through BitTorrent. The torrent file can be found at: http://azureus.sourceforge.net/torre...pm.bin.torrent
 
Old 06-06-2005, 01:52 AM   #12
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
I have just tried on FC4 Test 3 and indeed if you are root when you extract the file it automatically gets installed. I think this is a bit dangerous because its installed even if you have not requested the installation. Similar methods could be used to install malicious software without the knowledge of the user.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I get the rpm command and rpm build command on my Debian box? abefroman Debian 6 11-28-2005 12:38 PM
Java command not working, plugin does shea1roh Linux - Software 2 12-19-2004 03:18 PM
rpm -bp command not working says "-bp: unknown option" Niceman2005 Linux - Software 2 11-08-2004 01:36 AM
chmod command linuxtesting2 Linux - Newbie 2 09-03-2004 12:02 PM
rpm command not working sanjaya Linux - Software 7 02-20-2004 01:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration