Is Oracle JDK link broken for Linux? [closed] - linux

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I was running a tutorial on YouTube for installing Oracle JDK on Linux. My script seems to have worked but I can no longer run
wget http://download.oracle.com/otn-pub/java/jdk/7u3-b04/jdk-7u3-linux-i586.tar.gz
What new methodology or script can I use to install Oracle JSK on Linux?

Yes, the Oracle JDK link is broken, you have to click through the website and accept the terms.
Second link on Google, the first being this question (Wow, Googlebot is fast) is an Oracle discussion thread:
Hi,
Unfortunately we have to require license acceptance prior to download.
This can be implemented in one of two ways. Either we require
registration and log in prior to download, and as part of registering
you agree to reading and complying with licenses. Or we use a
click-through on download which avoids the need to register and log
in. We have chosen the latter for Java downloads as the least
intrusive method. We found out some time ago that scripts were being
used to circumvent click-through (in violation of site policies, and
frankly also of common sense) and have plugged this hole.
We understand that this makes command line updates from our main
website for Linux users impossible and are actively looking for other
ways to enable this use case.
Oracle JDK is based on OpenJDK (with a few added components like a
closed-source font rasterizer that we license from a third party) and
the latter is available as part of most Linux distributions, so it is
a good option unless you specifically need the Oracle certified
binaries.
Regards,
Henrik Ståhl Sr. Director, Product Management Java Platform Group
Oracle

The reason it doesn't work is pretty obvious if you look at what you get back:
In order to download products from Oracle Technology Network you must
agree to the OTN license terms.
Be sure that...
- Your browser has "cookies" and JavaScript enabled.
- You clicked on "Accept License" for the product you wish to download.
- You attempt the download within 30 minutes of accepting the license.
When you do it from a browser you have to select the radiobutton "Accept License Agreement" and that's when the cookie is set. You should be able to download it using links or lynx.

After agreeing and downloading the JDK, run this script:
#!/bin/bash
#Author: Yucca Nel http://thejarbar.org
#Will restart system
#Modify these variables as needed...
tempWork=/tmp/work
locBin=/usr/local/bin
javaUsrLib=/usr/lib/jvm
downloadDir=~/Downloads
sudo mkdir -p $javaUsrLib
mkdir -p $tempWork
cd $tempWork
#Extract the download
tar -zxvf $downloadDir/*linux*
#Move it to where it can be found...
sudo mv -f $tempWork/jdk* $javaUsrLib/
sudo ln -f -s $javaUsrLib/jdk1/bin/* /usr/bin/
#Update this line to reflect versions of JDK...
export JAVA_HOME="$javaUsrLib/jdk1.7.0_03"
#Extract the download
tar -zxvf $tempWork/*
#Move it to where it can be found...
sudo mv -f $tempWork/jdk1* $javaUsrLib/
sudo ln -f -s $javaUsrLib/jdk1*/bin/* /usr/bin/
sudo rm -rf $tempWork
#Update this line to reflect newer versions of JDK...
export JAVA_HOME="$javaUsrLib/jdk1.7.0_02"
if ! grep "JAVA_HOME=$javaUsrLib/jdk1.7.0_02" /etc/environment
then
echo "JAVA_HOME=$javaUsrLib/jdk1.7.0_02"| sudo tee -a /etc/environment
fi
exit 0

Related

how to install software on linux without root permissions

I need some help to install the ABySS assembler on PuTTY (virtual Linux) without root permission (as it takes a long time going via IT department etc.).
To be honest I've no idea where to start from, so I'll be very appreciated for step-by-step guide if that is not too much to ask.
Thanks in advance.
If you are referring to the software here, then it should be sufficient to follow the instructions here. Specifically, you should take note of the part labelled To install ABySS in a specified directory:, and specify a directory in your home directory that you have write access to. For example, I might:
mkdir ~/abyss
./configure --prefix=$HOME/abyss
make
make install
Note that I have removed sudo from before make install, so that you are trying to run the installation as a user rather than root. make install will put the software wherever you specified with --prefix.
However, this all depends upon the source code for any libraries upon which ABySS depends existing on your system as well. I expect you will fail at the ./configure step because some library is missing. In this case download the source code for those libraries and tell configure where you have put them (in your home directory), following the example given for Boost on that same page.

Using RPMs for installation on embedded system images

I'm trying to use RPMs to install public and private software into disk images that are eventually written to the boot flash of Linux based embedded systems.
My current methodology is to mount the image (/mnt/foo) read/write on a CentOS 6.5 box and use the rpm --installroot=/mnt/foo option. There are two problems:
--installroot=/mnt/foo appears to chroot into /mnt/foo, meaning that when the post install scripts run /bin/sh (etc.) they're actually using /mnt/foo/bin/sh (etc.) That's sort of workable if the target architecture is the same as the installation box but gets very messy if its not. I'm interested to hear if someone has solved this before.
At a higher level it would be nice to use yum or apt-get or ??? to handle package dependencies and repositories. yum is the obvious choice on CentOS but it has a weak grasp of non-native architectures and would likely require some hacking. apt-get looks more promising in that department but in truth I've never used it and my attempts to install it on CentOS 6.5 have left me in dependency hell.
This seems like a problem someone would have hit before but unfortunately everything I can find about RPMs and embedded systems assumes identical processor architectures.
Bottom line, I need to use RPMs to install software to a Linux image that will be the boot disk for a embedded system. Other than doing the rpm install as part of the image installation on the embedded system (our installation time is already a big problem) I'm open to just about anything.
Any suggestions will be gratefully received.
Have you tried using some continuous build system like Jenkins? You can use that to easily set up build hosts on any architecture/platform you like, so long as that platform has some basic tools (like ssh).
You could use a combination of the --installroot flag mentioned by other commenters, alongside of some VMs setup as build hosts in Jenkins in order to install your RPMs in a specific directory while avoiding any platform/architecture issues.
I'm not sure what your specific requirements are, but, depending on how far you are willing to go... RPMs are just compressed CPIO archives with a header, so you could use rpm2cpio piped to cpio to extract the files in the RPM. You can then extract the postinstall scripts using rpm -qp --scripts filename.rpm and run them yourself. The downside to this, is of course, that you lose a lot of the benefit of using RPM/yum in the first place like the automatic installation of dependencies, and so on.

access video file information using standard Unix utilities

I want to access video file information (specifically, the video horizontal and vertical dimensions) in the Bash terminal of Scientific Linux on a system over which I do not have root privileges. The setup is conservative and does not feature the modern utilities, such as exiftool and avprobe, that would be used to do this. What would be a way of accessing this information using standard Unix utilities or some other means likely to work on a conservative Linux setup? To be specific, I am looking for something such as the following:
<utility> video1.mp4
1280x720
Thanks for any ideas!
How to build and run typical open source software from source without root
Even if you don't have root, provided that:
you can at least use the compiler and related tools
you can download source code
you don't need too many strange libraries
then download the source code for your tool of choice and install it into $HOME/opt/somedir.
For example, for avprobe you could probably download the last stable source release, then build it like this:
tar xzf libav.....gz
cd libav.....
./configure --prefix=$HOME/opt/libav
make
make install
then run it as
$HOME/opt/libav/bin/avprobe
You may or may not need to tweak the value of LD_LIBRARY_PATH or various other things.

Running apt-get for another partition/directory?

I have booted my system from a live Ubuntu CD, and I need to fix some package problems. I have mounted my hard drive, and now I want to run apt-get as if I booted normally. ie change the working directory for apt-get so it will work on my hard drive. I have done this before, but I can't remember the syntax. I think it was only some flag, like this:
apt-get --root-directory=/mnt/partition1 install....
But I only get "Command line option...is not understood". Any ideas?
Also this should work:
sudo apt-get -o Dir=/media/partitioni1 update
chroot /mnt/partition1
If your system uses several disk partitions you may have to mount some of them in order to get the package system working (I stopped setting up multiple partitions 10 years ago when hard disks started to get too large for raw physical backup).
This wouldn't work if you don't already have a usable debian system in that location. – akostadinov
If you can't get the package system working when chrooting, perhaps it is too messed up to ever be trusted again - in my experience the effort to bring it back to life rarely pays. If that happens, be happy you can still access your HD, backup your data and perform a clean reinstall.
Some relevant comments from other answer:
apt-get -o RootDir=/tmp/test_apt sets (almost) all paths to be in the different root. btw on a running system, if you copy /etc/apt, /usr/lib/apt, and mkdir -p usr/lib etc var/cache var/lib/dpkg var/lib/apt/lists/partial var/cache/apt/archives/partial and finally touch var/lib/dpkg/status, then apt is going to work in that root. It can even work as a non-root user if you add the option -o Debug::NoLocking=1. The nolock option is necessary because I couldn't find a way to set the lock file inside the different root directory. – akostadinov
Work means using search and downloading packages and such operations. Actually installing is not possible if some essential packages are not already there. debootstrap can help if the goal is actually installing packages in a new root for whatever reason. – akostadinov
Running chroot /mnt/partition1 will start a new shell in which the root of the filesystem is /mnt/partition1. Assuming the apt-get on your hard drive still works correctly, you can proceed from there.
dpkg --root=/mnt/partition1 -i mypackage.deb is an option that doesn't require chroot, but does require you to download the package yourself.

Where do you download Linux source code? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
Say I'm interested in the source for one particular Linux utility, like factor. Where can I find the source code for that utility?
You can also find out which package the binary comes from an download that packages source code.
On Debian (and Ubuntu and anything else that's based on Debian) you do that like this:
$ dpkg -S /usr/bin/factor
coreutils: /usr/bin/factor
$ apt-get source coreutils
The first command will check which package contains the file you are searching for (use "which factor" to find out which binary is executed when you just type "factor").
The second command will download and unpack the sources (including the patches applied to build the package) to the current directory, so it should be executed in a dedicated or temporary directory.
I'm pretty sure rpm-based distributions have a similar mechanism, but I don't know their commands.
What I did was type
man factor
and went to the bottom and found 'GNU coreutils 6.10'. So I googled 'coreutils' and... found the site joschi just linked to.
To find the package a binary comes from, in rpm based system, you might type:
$ rpm -qf /usr/bin/factor
which will print the package name. Instead, with:
$ rpm -qif /usr/bin/factor
you will get also information on a package, including it's home page in many cases.
Source rpms also exist, but how to get them depends on the high-level package manager used on top of RPM (yum, urpmi, apt-get4 for rpm, ...).
On most systems, also, /usr/share/doc/ contains some documentation on the program, and the website link is pretty often found somewhere there, maybe in the README.
Usually you'll find the source code on the website of the program if it is open source. In this case here since factor is part of coreutils.
On Gentoo, simply look in the ebuild you compiled the package with :D.
If you're not sure?
# which factor
/usr/bin/factor
# grep '/usr/bin/factor' /var/db/pkg/*/*/CONTENTS
/var/db/pkg/sys-apps/coreutils-6.12-r2/CONTENTS:obj /usr/bin/factor 5aaf903daa4345efb11618b3cb47e9a5 1224224574
/var/db/pkg/sys-apps/coreutils-6.12-r2/CONTENTS:obj /usr/lib64/debug/usr/bin/factor.debug 517d965636850633e9b15926dde8c222 1224224575
# cat /var/db/pkg/sys-apps/coreutils-6.12-r2/SRC_URI
ftp://alpha.gnu.org/gnu/coreutils/coreutils-6.12.tar.lzma mirror://gnu/coreutils/coreutils-6.12.tar.lzma mirror://gentoo/coreutils-6.12.tar.lzma mirror://gentoo/coreutils-6.12-patches-1.0.tar.lzma http://dev.gentoo.org/~vapier/dist/coreutils-6.12-patches-1.0.tar.lzma
# cat /var/db/pkg/sys-apps/coreutils-6.12-r2/HOMEPAGE
http://www.gnu.org/software/coreutils/
But of course, the source code is probably still available in /usr/portage/distfiles .
Another, very good approach is to use Google Code Search. For example, a search for factor coreutils (see the man page or factor --help to see that it's from coreutils) came up with the package as the second result. Two clicks away I was browsing factor.c online.
Google Code Search searches most public source code. You can use regexps and many advanced search options, including restricting by language and license.
I usually find a link to the source, homepage, and other useful information by doing a search on freshmeat.
You may want to check out SourceForge.net.

Resources