LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware64 13.1 packages JRE and JDK conflict? (http://www.linuxquestions.org/questions/slackware-14/slackware64-13-1-packages-jre-and-jdk-conflict-828979/)

mlpa 08-28-2010 06:30 AM

Slackware64 13.1 packages JRE and JDK conflict?
 
Hi, the packages jre and jdk conflict with each other, to install jdk I should remove jre?

Hangdog42 08-28-2010 08:19 AM

I've got both installed on my machine with no problems.

mcnalu 08-28-2010 08:42 AM

I've never experienced a conflict between jre and jdk and I've been using them in all versions since 11.

I did experience a problem with netbeans 6.x that once may be think something like that was happening, but it turned out to be a netbeans problem.

wadsworth 08-28-2010 01:25 PM

Quote:

Originally Posted by mlpa (Post 4080498)
Hi, the packages jre and jdk conflict with each other, to install jdk I should remove jre?

Yes, you're correct.
JRE (runtime environment) is included in the JDK (development kit).
You should uninstall one before installing the other.

JWilliamCupp 08-09-2011 09:16 PM

JRE / JDK Conflict for Opera
 
I use the Opera web browser. Removing JRE removes the folder /usr/java/jre1.6.0_26 and thus, Opera cannot use Java any longer. As explained on the Opera plugins page, Opera does not use the JRE plugin but invokes the binary file directly. Opera says to "locate libnpjp2.so" and point the plugins directory there to find the Java plugin.

However, after I removed the JRE and installed JDK, "locate libnpjp2.so" came up empty.

What I had to do was make a copy of /usr/java/jre1.6.0_26 elsewhere, remove JRE, and install JDK, then replace the jre1.6.0_26 folder at /usr/java/jre1.6.0_26 in order to have both JDK installed and Opera capable of running Java content.

- Bill

ReaperX7 08-09-2011 10:24 PM

JDE and JRE should not conflict with each other. One is a runtime kit and the other is the software developers kit. You can actually have both on a system without penalty.

Java using applications like Web Browsers usually use a symbolic linked file and not the actual binary. If they aren't, then the authors probably have them built incorrectly.

Diantre 08-09-2011 11:05 PM

I was curious about this issue so I compared the listings from both JRE and JDK packages to see if there are duplicated files.

Problem is, I don't have Slackware64 13.1 handy, only Slackware64 13.37, but the procedure should be the same. This is what I did:


Code:

$ tar -tvf jre-6u25-x86_64-1.txz | awk '{print $6}' > jre.files
$ tar -tvf jdk-6u25-x86_64-1.txz | awk '{print $6}' > jdk.files
$ comm -1 -2 <(sort jdk.files) <(sort jre.files)

There are a few files present in both packages. This is the result of the comm command:

Code:

./
etc/
etc/profile.d/
install/
install/doinst.sh
install/slack-desc
usr/
usr/lib64/
usr/lib64/java/
usr/lib64/java/COPYRIGHT
usr/lib64/java/LICENSE
usr/lib64/java/THIRDPARTYLICENSEREADME.txt
usr/lib64/java/bin/
usr/lib64/java/bin/java
usr/lib64/java/bin/javaws
usr/lib64/java/bin/jcontrol
usr/lib64/java/bin/keytool
usr/lib64/java/bin/orbd
usr/lib64/java/bin/pack200
usr/lib64/java/bin/policytool
usr/lib64/java/bin/rmid
usr/lib64/java/bin/rmiregistry
usr/lib64/java/bin/servertool
usr/lib64/java/bin/tnameserv
usr/lib64/java/bin/unpack200
usr/lib64/java/lib/
usr/lib64/java/lib/jexec
usr/lib64/java/man/
usr/lib64/java/man/ja_JP.eucJP/
usr/lib64/java/man/ja_JP.eucJP/man1/
usr/lib64/java/man/ja_JP.eucJP/man1/java.1
usr/lib64/java/man/ja_JP.eucJP/man1/keytool.1
usr/lib64/java/man/ja_JP.eucJP/man1/orbd.1
usr/lib64/java/man/ja_JP.eucJP/man1/pack200.1
usr/lib64/java/man/ja_JP.eucJP/man1/policytool.1
usr/lib64/java/man/ja_JP.eucJP/man1/rmid.1
usr/lib64/java/man/ja_JP.eucJP/man1/rmiregistry.1
usr/lib64/java/man/ja_JP.eucJP/man1/servertool.1
usr/lib64/java/man/ja_JP.eucJP/man1/tnameserv.1
usr/lib64/java/man/ja_JP.eucJP/man1/unpack200.1
usr/lib64/java/man/man1/
usr/lib64/java/man/man1/java.1
usr/lib64/java/man/man1/keytool.1
usr/lib64/java/man/man1/orbd.1
usr/lib64/java/man/man1/pack200.1
usr/lib64/java/man/man1/policytool.1
usr/lib64/java/man/man1/rmid.1
usr/lib64/java/man/man1/rmiregistry.1
usr/lib64/java/man/man1/servertool.1
usr/lib64/java/man/man1/tnameserv.1
usr/lib64/java/man/man1/unpack200.1
usr/lib64/mozilla/
usr/lib64/mozilla/plugins/
usr/share/
usr/share/applications/
usr/share/applications/sun-java.desktop
usr/share/applications/sun-javaws.desktop
usr/share/applications/sun_java.desktop
usr/share/icons/
usr/share/icons/hicolor/
usr/share/icons/hicolor/16x16/
usr/share/icons/hicolor/16x16/apps/
usr/share/icons/hicolor/16x16/apps/sun-java.png
usr/share/icons/hicolor/16x16/apps/sun-javaws.png
usr/share/icons/hicolor/16x16/apps/sun-jcontrol.png
usr/share/icons/hicolor/16x16/mimetypes/
usr/share/icons/hicolor/16x16/mimetypes/gnome-mime-application-x-java-archive.png
usr/share/icons/hicolor/16x16/mimetypes/gnome-mime-application-x-java-jnlp-file.png
usr/share/icons/hicolor/16x16/mimetypes/gnome-mime-text-x-java.png
usr/share/icons/hicolor/48x48/
usr/share/icons/hicolor/48x48/apps/
usr/share/icons/hicolor/48x48/apps/sun-java.png
usr/share/icons/hicolor/48x48/apps/sun-javaws.png
usr/share/icons/hicolor/48x48/apps/sun-jcontrol.png
usr/share/icons/hicolor/48x48/mimetypes/
usr/share/icons/hicolor/48x48/mimetypes/gnome-mime-application-x-java-archive.png
usr/share/icons/hicolor/48x48/mimetypes/gnome-mime-application-x-java-jnlp-file.png
usr/share/icons/hicolor/48x48/mimetypes/gnome-mime-text-x-java.png
usr/share/mime/
usr/share/mime/packages/
usr/share/mime/packages/x-java-archive.xml
usr/share/mime/packages/x-java-jnlp-file.xml


ReaperX7 08-10-2011 12:12 AM

The JDE files do overwrite the JRE files, but they are the same exact files in essence minus a few JRE specific ones used by various programs. In reality JRE and JDE both are subsets of the entire Java package. One is geared for software development and the other for general usage, but they can co-exist.

Diantre 08-10-2011 12:46 AM

Yes, they can co-exist. But, rephrasing the OP's question, is it correct to affirm that if JDK is installed, then JRE is not needed?

ReaperX7 08-10-2011 01:03 AM

You still need JRE for Java applications. The JDE only provides basically what any other developer package has like headers, libraries, code samples, documentation, and a basic runtime(s). The JRE is what provides the shared libraries for the system and all other applications that are required for Java using applications to work correctly.

So yes, JRE regardless is still required.

gnashley 08-10-2011 03:32 AM

And the 'conflicting' files are no problem, either. Many Slackware packages contains duplicates -like glibc-solibs and glibc, and aaa_elflibs contains duplicates of many packages.

Mike_M 08-10-2011 04:10 AM

Quote:

Originally Posted by ReaperX7 (Post 4438421)
You still need JRE for Java applications. The JDE only provides basically what any other developer package has like headers, libraries, code samples, documentation, and a basic runtime(s). The JRE is what provides the shared libraries for the system and all other applications that are required for Java using applications to work correctly.

So yes, JRE regardless is still required.

Specifically, what can't a person run with the JDK package that they would need the JRE package for? My understanding is that the Slackware JDK package from extra/ is meant to fully replace the JRE package. The JDK package contains a /usr/lib(64)/java/jre/ directory with what should be a full implementation of the JRE. Granted I don't have much exposure to Java, the programs I have run work just fine with the JDK package installed in place of the JRE package.

janhe 08-10-2011 05:18 AM

I once had a problem when compiling a java program. I believe it was the maven framework that gave the problems.

Thing is, the JDK does include the runtime. But it is located in a different directory. If you have both the JRE and the JDK, the JRE will be preferred by programs before the JDK's runtime.

Since maven looks for the JDK in a directory relative to the runtime, that gave me problems. Uninstalling the JRE solved the thing. Never had any problems since then.

Quote:

Originally Posted by JWilliamCupp (Post 4438294)
I use the Opera web browser. Removing JRE removes the folder /usr/java/jre1.6.0_26 and thus, Opera cannot use Java any longer. As explained on the Opera plugins page, Opera does not use the JRE plugin but invokes the binary file directly. Opera says to "locate libnpjp2.so" and point the plugins directory there to find the Java plugin.

However, after I removed the JRE and installed JDK, "locate libnpjp2.so" came up empty.

What I had to do was make a copy of /usr/java/jre1.6.0_26 elsewhere, remove JRE, and install JDK, then replace the jre1.6.0_26 folder at /usr/java/jre1.6.0_26 in order to have both JDK installed and Opera capable of running Java content.

- Bill

locate is an utillity that looks for files in an index. This index is updated every night by a cron job (somewhere around 4 in the morning). locate doesn't look directly at the file system, so changes that were made since the last index update will not be reflected.

Try this to find the library:
Code:

find /usr/ -name libnpjp2.so
The difference with locate is that find will look directly at the file system. This means it takes longer to run, but it also works for things that changed recently.

Diantre 08-10-2011 05:29 AM

Quote:

Originally Posted by Mike_M (Post 4438522)
My understanding is that the Slackware JDK package from extra/ is meant to fully replace the JRE package. The JDK package contains a /usr/lib(64)/java/jre/ directory with what should be a full implementation of the JRE.

That was my understanding as well. The difference is that JDK installs libraries to /usr/lib(64)/java/jre/lib and JRE installs to /usr/lib(64)/java/lib. After comparing both directories it seems to me the JDK contains all libraries installed by the JRE.

janhe 08-10-2011 06:48 AM

It is simple.
Quote:

Originally Posted by jdk-6u20-x86_64-1 slack-desc
This package contains everything you need to run Java(TM).

If you install the JDK, you don't need the JRE, the JDK contains everything you need to run Java programs.

Quote:

Originally Posted by JWilliamCupp (Post 4438294)
What I had to do was make a copy of /usr/java/jre1.6.0_26 elsewhere, remove JRE, and install JDK, then replace the jre1.6.0_26 folder at /usr/java/jre1.6.0_26 in order to have both JDK installed and Opera capable of running Java content.

No you had not. Granted, it worked, but it wasn't necessary.
You should have pointed Opera to the file in the JDK, it is there, see my previous post in this thread for an explanation why you didn't find it.


All times are GMT -5. The time now is 03:49 PM.