How do I install Java JRE on Linux?
java - How to install the JDK on Ubuntu Linux - Stack Overflow
Why is Java considered more of a "first class citizen" in the Linux world compared to .NET/Mono?
[workflow] Best setup for developing in Java on linux?
I use Ubuntu/Mint with Oracle's JDK. IntelliJ for the IDE. There is both a free and pay version of IntelliJ, but I find it to be faster, cleaner GUI, and has fewer bugs/really annoying quirks than Eclipse.
More on reddit.comVideos
I followed the instructions on the Java official website but when I tried to run some thing related to JRE on the terminal it says Java not found
Referring to Ask Ubuntu question How to set JAVA_HOME for OpenJDK?,
How to install Open JDK (Java developement kit) in Ubuntu (Linux)?
Open Terminal from Application Dash or press Ctrl+Alt+T
Update repository:
sudo add-apt-repository ppa:openjdk-r/ppa # only Ubuntu 17.4 and earlier sudo apt updateOptional: To search available distributions of
openjdk, use the following command:apt search openjdkInstall the appropriate version with the following command:
sudo apt install openjdk-8-jdk sudo apt install openjdk-8-source #this is optional, the jdk source codeFor
JAVA_HOME(Environment Variable) type command as shown below, in "Terminal" using your installation path...export JAVA_HOME=/usr/lib/jvm/java-8-openjdk(Note:
/usr/lib/jvm/java-8-openjdkis symbolically used here just for demostration. You should use your path as per your installation.)For
PATH(Environment Variable) type command as shown below, inTerminal:export PATH=$PATH:$JAVA_HOME/binTo check your installation:
java -version
The following used to work before the Oracle Java license changes in early 2019.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
The PPA is discontinued, until the author finds a workaround for the license issues.
try using this command in the terminal:
sudo apt install default-jre
then you can try using:
java -version
to check version
Do not download binaries straight from the Internet. That is not how to install software on Linux. It is how Windows users do it, but it is wrong on Linux.
Install it from the package manager. Google for instructions for your version, since you did not bother to tell us what you are running. Without detailed specific info we can't help you.
Objectively speaking, they're both gc runtimes, one compiles to bytecode and the other to CIL. In that sense, none of them are "native citizens" of Linux, for lack of a better word.
Now, the spite of the Tux folks against Microsoft is also quite understandable given the history of open source and the early days of evolution of both the operating systems. But times have changed today, isn't it? Today's linux users and developers shouldn't have that baggage on their shoulders while programming.
But to this day, things like MonoDevelop and the mono runtime aren't highly used and/or supported in the Linux distros? If you want to create a cross-platform GUI, for example, most would think of a Java framework like Swing or JavaFX instead of Mono. WinForms support was already expected on the Linux distro considering the Mono project has been going on for so long. Where do you think the bottleneck really is? And where do you see the future of ".NET on Linux" going?
I know programming and did a bit of Java before. Now I want to do serious development (for academic purposes, so not that large scale).
What's the best setup for Java on linux (ubuntu)? I remember from back in the days 3 or 4 flavours of Java co-existing on my system, and things not working terribly well.
Which flavour should I go for if I want to use Java professionally? How do I install it and make sure it's the main one used?
Is Eclipse still the best thing in town? (never liked it, always used gedit, but I guess I'll have to change my ways)
Would I use the same setup for writing smartphone apps? (as a hobby, not part of the job)
Thank you all in advance!
Update: Thanks a lot for all the detailed answers!
So it looks like the java situation got a bit better on linux, and openJDK is a solid version. Good to know.
IDE-wise: many votes for eclipse, but intelliJ and netbeans are good alternatives. I'll give each a go.
Android dev: Eclipse is preferable.
Also important point that is shared by many: get java from the repositories,but the IDEs directly from the original websites (easier to configure, up-to-date and less bloated).
I use Ubuntu/Mint with Oracle's JDK. IntelliJ for the IDE. There is both a free and pay version of IntelliJ, but I find it to be faster, cleaner GUI, and has fewer bugs/really annoying quirks than Eclipse.
I've been using Ubuntu and Java for about 6 years now at work. I do a combination of mobile, web, and server development. I've used JEE, Android, Spring, and hobbied in JavaFX (both 1.0 and 2.0). Here is the best I can come up with.
For the most part don't use the Ubuntu packages for anything but OpenJDK. Install Eclipse and/or Netbeans by hand. I like keeping everything in /opt with a symlink to the current version. (IE I will have /opt/tomcat-6 and /opt/tomcat-7 with /opt/tomcat pointing to tomcat 7. Same goes for Groovy, java FX, alternative JDKs, etc).
If you find yourself needing a specific JDK (Oracle 32 bit for Java FX as an example), you should use the alternatives system to point Ubuntu at it. As long as you make sure you get javac, java, and javah updated you will be golden. Eclipse et al behave correctly. Alternatively you can set this up per IDE. It really is a matter of preference.
Ever since OpenJDK got good, most of the problems we had with Java on Linux went away.
TL;DR; Eclipse and Netbeans are good enough. Install OpenJDK from apt and get everything else from the official build. Put everything you need in /opt and use the IDE's platform tools or the Alternatives system to make sure you are using the Java you want.
If your java version more than 1.6 then it should work
java -version
if version is not installed it returns error message
Please share some snapshot so i can rectify it
To answer your question directly, you can use
rpm -qi java
OR
yum info "java"
For future Referenecs . You can try any of these commands.
rpm -qi "package_name_without_quotes"
It gives information of installed package. To display information about one or more packages (glob expressions are valid here as well), use the following command :
yum info "package_name_without quotes"
OR
yum list "package_name_without_quotes"
OR
yum --showduplicates list "package_name_without_quotes"
The yum info package_name command is similar to the rpm -q --info package_name command, but provides as additional information the ID of the Yum repository the RPM package is found in.
You can also query the Yum database for alternative and useful information about a package by using the following command :
yumdb info "package_name_without_quotes"
This command provides additional information about a package, including the check sum of the package (and algorithm used to produce it, such as SHA-256), the command given on the command line that was invoked to install the package (if any), and the reason that the package is installed on the system.