Hi All,

I'm attempting to install Jre7 on my newly installed Ubunto OS. I've been looking here and it is telling me to move the unzipped folder to /usr/lib but where is that? In the Terminal I tried finding it by changing directories but to no avail and I'm getting more confused. I'm completely new to Ubuntu and Linux and am finding this crossover from windows to be difficult with regards to installig software. iamthwee, you were right, this is tricky. Anyhow, if someone could assist me I would be most grateful.

Dani AI

Generated

Good catch from — the typo between /user and usr is a common source of confusion for newcomers. The directory you normally want for manually installed JVMs is a dedicated system folder, not a random place under your home directory. Ubuntu (and most Linux distros) conventionally keeps Java installs under /usr/lib/jvm, which keeps things tidy and makes it easy to register the runtime with the system so java points to the right binary. ’s advice to follow the distro-friendly instructions is also sound: packaged installs handle permissions and alternative links for you.

If you keep the manual route, the usual workflow is: create the JVM directory if missing, move the unzipped JRE into it, make sure root owns the tree, register the java binary with the alternatives system, and verify with a version check. Example commands (replace <unzipped-folder> with the actual folder name you created when unzipping):

sudo mkdir -p /usr/lib/jvm
sudo mv <unzipped-folder> /usr/lib/jvm/
sudo chown -R root:root /usr/lib/jvm/<unzipped-folder>
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/<unzipped-folder>/bin/java 1
sudo update-alternatives --set java /usr/lib/jvm/<unzipped-folder>/bin/java
java -version

Notes and cautions: pick the package that matches your architecture (i386 vs amd64), and remember a JRE (not a JDK) provides the java runtime but not javac. Manually installed Oracle JREs won’t receive automatic security updates via apt unless you use a supported repository, so consider installing OpenJDK from Ubuntu’s packages or a maintained Oracle packaging solution unless you have a specific requirement for Java 7. Java 7 is old and no longer receiving public security updates, so prefer a supported LTS (for example Java 8/11/17) if possible.

Recommended Answers

All 5 Replies

You should be able to just cd /usr/lib ? That, or try cd /lib/. I'm not 100% familiar with Ubuntu, but I've never seen a distro without a /usr/lib directory.

commented: Thanks +4

Thanks Assembly GUy, I tried cd /user/lib but not cd /lib/ and will try that when I'm in front of my laptop tonight.

I tried cd /user/lib

Did you try /user/lib or /usr/lib? There's no such thing as /user/lib (note the 'E' in user). Linux likes to shorten the root folders to three-letter names. Please check you were trying usr instead of user

Hi Assembly GUy, I wasn't able to do much on my laptop this previous weekend but will get back on this to let you know my results. In saying that, my spelling error was on the forum and I'm quite certain I used the proper folder name but I will test that again this evening when i am home and have a chance. Thanks for your assistance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.