How can I install Eclipse and Java SDK on Ubuntu? - java

I have just downloaded Ubuntu. It runs much faster than my Windows XP. But, I don't know how I can set up Eclipse v4.2 (Juno), or the Java SDK. I am currently developing in the Lightweight Java Game Library, so I might need some help with that too.

Execute this in your terminal:
sudo apt-get install eclipse
sudo apt-get install openjdk-6-jdk openjdk-6-source openjdk-6-demo openjdk-6-doc openjdk-6-jre-headless openjdk-6-jre-lib
The first one installs Eclipse (you will be asked to enter your password), and the second one installs all the Java stuff you may need!

Don't install Eclipse from the Linux repositories. These repositories may not be up-to-date with the last versions released by Eclipse. A better approach is to follow the instructions in this answer from Ask Ubuntu. For Java programming, make sure you have a JDK and a JRE installed
apt-get install openjdk-7-jdk openjdk-7-jre
You can download whatever Eclipse Java IDE version suits you best from the Eclipse website (link to the Eclipse v4.4 (Luna) release).

You might want to consider installing Sun Java 6 for your Java programming needs; correct me if I'm wrong, but I feel that OpenJDK may still be lacking in some libraries and compatibilities.
If you want to install Java 6 on your machine, you can follow this guide on how to do so: https://codingforme.wordpress.com/2012/05/14/installing-oracle-java-jdk-6-or-7-on-ubuntu-12-04/

Java installation on Ubuntu:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
Eclipse IDE installation on Ubuntu:
Since it requires a detailed list of steps, I would suggest you to visit the blog post Install Eclipse IDE Mars in Linux Ubuntu to check out steps to install Eclipse on Linux Ubuntu.

You don't really install Eclipse - you just download the folder and run the program - just like in windows. Just make sure you download a Linux version.
To install JDK, type:
sudo apt-get install openjdk-6-jdk
You will be asked to type in your password before the installation will begin. You could also install JDK through the software manager.

Just remove all Eclipse packages typing:
sudo apt-get autoremove eclipse
And with tab find all installed Eclipse packages.
Do the same with Java.
I just reinstalled Eclipse with the command
sudo apt-get install eclipse
which also contains Java.

Related

How can I install libgfortran3 in Ubuntu/Lubuntu 20.04?

I'm using jBlas and it require libgfortran3 and tell me to install it from:
sudo apt-get install libgfortran3
But I'm using Lubuntu 20.04, which use the same packages as Ubuntu 20.04. I can't find the package here
https://packages.ubuntu.com/search?keywords=libgfortran3
So what should I do?
In short, libgfortran3 is no longer supported in Ubuntu 20.04. It depends on an older version of gcc which is no longer maintained in this version of the distribution.
As an alternative, you might want to try installing its successor package with:
sudo apt-get install libgfortran5
It will provide these files for your Ubuntu installation:
/usr/lib/x86_64-linux-gnu/libgfortran.so.5
/usr/lib/x86_64-linux-gnu/libgfortran.so.5.0.0
/usr/share/doc/libgfortran5
This way, you have an option of dynamically loading/linking against libgfortran at runtime.
Hope it helps.
If you have to use libgfortran3, you can just copy a libgfortran.so.3 in /usr/lib/x86_64-linux-gnu/.
It works for me.

Can't install OpenJDK 8 due to not having an installation candidate

I am on Debian 9 and am trying to install OpenJDK 8. When I enter the command sudo apt install openjdk-8-jre-headless, however, I get an error saying E: Package 'openjdk-8-jre-headless' has no installation candidate. I have installed build-essential and git, but it still does not work. Does anyone know how to fix this?
git has nothing to do with it. Your OS can't find a package containing openJDK 8. Try apt-cache openjdk-8 to see if there are any known packages containing what you need.
If the cachecommand finds a package, use your favorite editor to add it to /etc/apt/sources.list and try installing again.
If cache cannot find what you want in a current package, search through old packages at http://snapshot.debian.org/.
You can download by the following way :
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jre

How to change the version of java installed in BOSS Linux?

I am trying to change java installed in boss Linux because am trying to install eclipse oxygen which needs java8. First I couldn't find where the jdk installed. Currently 1.7.0_73 installed. I just downloaded the tar.gz of jdk8. Extracted in a location. Setted java home and path pointing bin. But still am getting error during eclipse installation that version 1.8 is required.
Well as Wikipedia states that
BOSS Linux is an "LSB certified" Linux distribution :
the software has been certified by the Linux Foundation
for compliance with the Linux Standard Base standard.
BOSS Linux is derived from Debian Linux.
Note that It is derived from Debian Linux and uses apt to handle packages for updates or upgrades. On that note, you just have to use apt
command to upgrade to version you want.
Installing java version 1.8 by installing OpenJDK v8
To install java version 1.8 (OpenJDK v8), type following on terminal :
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
If you only want to install the Java Runtime Environment :
sudo apt-get install openjdk-8-jre
Feel free to add-in more details to the answer.

Install webstorm but no jdk found on ubuntu 14.04LTS

I am trying to install webstorm, but when I try to run the *.sh file it gives me error of not having java environment available.
So I tried to look into the official documentation
But the steps to install the jdk didn't worked. I tried to locate java folder, but couldn't locate this directory /usr/bin/java
Please guide me how I can install webstorm now?
Java generally installs in /usr/lib/jvm/java-[major version]-openjdk-[arch]. Install a package such as openjdk-7-jdk and check in that location.
If you already have java installed, running which java will tell you the path of the java executable.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
I haven't tried with java-8. Then:
sudo update-alternatives --java
And set auto-mode or java-7 (You might try with java-8)
First check the about java version
java -version
if its not returning you need to check your installed jdk
go to
cd /usr/lib/jvm
if you are finding something which start with java_XXXX
it means this is the only your jdk, and you can set JAVA_HOME as well path till bin folder by using export
I had a similar problem, during installation of eclipse (openjdk-7-jdk was required). I used
> sudo apt-get update
> sudo apt-get install ...
and it worked.
You should just install a JRE (to allow Java execution programs) and not a JDK (to develop Java programs).
No need a JDK to allow Webstorm to lauch.
On ubuntu : apt-get install default-jre
Have a nice day :)
David

Getting started Java with Linux OS

I know this is very basic question, but these days I have done all my Java programs on Windows OS. But now I like to go with Linux.
How JDK and all be installed in Linux OS?
I am using Ubuntu 10.04 LTS.
That is dependent on the distribution you are using -- provide more details so people can be more helpful.
In most distributions however this is as simple as installing a package from the official repositories.
For example, in Debian/Ubuntu etc. you can do:
sudo apt-get install sun-java6-jdk
which will get you both the JDK and the JRE which is a dependency.
On Ubuntu:
$ sudo apt-get install openjdk-6-jdk openjdk-6-demo openjdk-6-doc
gets you the SDK, its demos and documentation. You should then be able to run the first set of examples.
It depends on your distribution. In Ubuntu you would do something like this (as root)...
# aptitude search jdk
After your choice, you install it.
# aptitude install sun-java6-jdk
Don't bother about downloading anything from any website. The package manager (apt-get, aptitude) is doing that for you.
Many Linux distributions package the OpenJDK into their repositories so you can install Java like any other application. If you want the Sun version of Java then you can download a bin or rpm file directly from Sun/Oracle that you can install manually.
The Sun/Oracle version can be found here: http://java.sun.com/javase/downloads/widget/jdk6.jsp Just select Linux as your platform in the form.
In addition to others' answers: If you need Java packages beyond what your distro provides, then check out the JPackage project. JPackage provides RPMs (so it won't work on Debian or Ubuntu, unless you use Alien) of a large number of Java libraries, frameworks, and tools.
As people have noted, you can use apt-get to install the JDK:
sudo apt-get install sun-java6-jdk
Also, if you're looking for a graphical editor, Eclipse is a good one, especially when you're not very familiar with Unix operating systems. It also should come with the JDK included with the default install. You can download that with:
sudo apt-get install eclipse
As Tedil mentioned, you can also get this without the console work via Ubuntu's Software Center in the Applications menu from the top bar.

Categories