1

I am new to Linux and installed Ubuntu. Fine. I gone through the basics of file system and basic things to know.

I installed Jdk1.7. by downloading the related .rpm file from oracle website. I installed Eclipse. I gave the the installed jdk1.7 jre folder in the eclipse project classpath.

But it is not identifying that and a simple java code is not getting compiled.

In one of the forums I found that we should use openjdk for linux distributions.

could someone explain me Why is that? and am I doing anything wrong by installing the jdk7 from oracle website in these linux distributions?

What difference they make?

Thanks

1
  • 1
    I'm using UBUNTU + Oracle-JDK and is pretty well here. Commented Jul 1, 2012 at 10:49

4 Answers 4

2

No, you don't have to use openjdk, any jdk should work fine. You say that you gave path to the jre in the jdk, not jdk itself? JRE has no compiler, JDK has.

Sign up to request clarification or add additional context in comments.

7 Comments

Thanks. Yep. I installed jdk1.7. My directory structure is /usr/java/jdk1.7. In eclipse windows-> preferences -> installed jres I gave /usr/java/jdk1.7. But it is not taking all the jar's required. I tried /usr/java/jdk1.7/jre as well. But no use. I don't see the required jar files in the library path.
do you know which jar files are missing?
Those .jar files missing when I add my jdk1.7 as jre home is as, rt.jar, jce.jar, resources.jar etc.,
how did you install the jdk? you say you downloaded an rpm? did you use alien to install it?
I have downloaded the rpm. Now I used alien to make rpm to deb. Now I used 'sudo dpkg -i jdk1.7.deb' to unpack it. Well I see the above mentioned .jar files in the unpacked /usr/java/jdk1.7/jre/lib directory. But if I point the eclipse "installed jre" to "/usr/java/jdk1.7" it is not showing up those jar in the list of eclipse added libraries. I tried pointing to "/usr/java/jdk1.7/jre" as well. But no use.
|
0

Try

sudo apt-get install openjdk-6-jdk eclipse

and see if it helps.

Comments

0

The Openjdk or icedtea or ... are JRE or JDK which try to be as open as possible. Oracles JDK/JRE is not Open enough in respect to the open source community, which is something the usual Linux user doesn't want in its Linux distribution as default implementation.

For a to releasing product you should specify the supported/tested Java implementation. There can be difference for example in performance or in tooling.

For developing with eclipse you don't necessarily need a JDK, because eclipse has its own Java Compiler. But it is recommended to use a JDK. It has nice tools and for some projects you need a JDK.

Comments

0

(The oracle jdk (and jre) are working just fine (at the current u05 release)).

Given that I've understood where you unpacked/put/installed the jdk (check the path), the following commands should fix a lot for you.

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk1.7/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk1.7/bin/javac" 1
(
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/java/jdk1.7/bin/javaws" 1
)

sudo update-alternatives --config java
sudo update-alternatives --config javac

Hopefully this should make ubuntu take care of your java specific env. variables.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.