You are not logged in.

#1 2007-07-25 10:35:29

steven
Member
Registered: 2007-07-17
Posts: 56

Why does jdk depend on jre ?

Installing jdk through pacman calls jre as a dependancy, however, the jdk packages shouldn't require jre (the functionality is included with jdk).

Note:

JDK 6 Update 2
The Java SE Development Kit (JDK) includes the Java Runtime Environment (JRE) and command-line development tools that are useful for developing applets and applications.

http://java.sun.com/javase/downloads/index.jsp

and

Contents of the JDK

...

Runtime Environment
(In the jre/ subdirectory) An implementation of the Java Runtime Environment (JRETM) for use by the JDK. The JRE includes a JavaTM Virtual Machine (JVMTM), class libraries, and other files that support the execution of programs written in the JavaTM programming language.

http://java.sun.com/javase/6/webnotes/README.html

In the past, on other distro's I've never installed JRE when I wanted JDK. Is this an error on the maintainers part or...?

Last edited by steven (2007-07-25 10:45:04)

Offline

#2 2007-07-25 11:27:51

AndyRTR
Developer
From: Magdeburg/Germany
Registered: 2005-10-07
Posts: 1,641

Re: Why does jdk depend on jre ?

check our jdk PKGBUILD and you will find a line   rm -rf linux-jdk/jre wink

Offline

#3 2007-07-25 11:43:47

steven
Member
Registered: 2007-07-17
Posts: 56

Re: Why does jdk depend on jre ?

Is there any particular reason why? Is the included jre functionality that ships with the jdk somehow lacking in comparison to the standalone jre?

I'm just curious if there's a good reason for it, considering I've never had to have both installed in the past and never had any issues.

Last edited by steven (2007-07-25 11:44:54)

Offline

#4 2007-07-25 11:50:28

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Why does jdk depend on jre ?

steven wrote:

Is there any particular reason why? Is the included jre functionality that ships with the jdk somehow lacking in comparison to the standalone jre?

I'm just curious if there's a good reason for it, considering I've never had to have both installed in the past and never had any issues.

I don't understand what's wrong with the current way.
Why would you want to install jdk when you only need jre (think about all packaged java apps) ?
And then, if you do need to install jdk, but already have jre installed, what do you do in this case ? Install jre a second time ?
It seems logical to remove jre from jdk, and only install the jdk specific stuff then, doesn't it?


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#5 2007-07-25 12:11:01

steven
Member
Registered: 2007-07-17
Posts: 56

Re: Why does jdk depend on jre ?

shining wrote:
steven wrote:

Is there any particular reason why? Is the included jre functionality that ships with the jdk somehow lacking in comparison to the standalone jre?

I'm just curious if there's a good reason for it, considering I've never had to have both installed in the past and never had any issues.

I don't understand what's wrong with the current way.
Why would you want to install jdk when you only need jre (think about all packaged java apps) ?
And then, if you do need to install jdk, but already have jre installed, what do you do in this case ? Install jre a second time ?
It seems logical to remove jre from jdk, and only install the jdk specific stuff then, doesn't it?

What!?

If I only needed the jre, I wouldn't install the jdk at all.

If I want to install just jdk for development, I shouldn't need the jre at all. I downloaded 60MB instead of 30MB. I was simply curious why both were installed. Surely, it wouldn't be difficult for the packaging system to detect if jre is already installed and install jdk appropriately (if you're in such a situation), but on a clean system, if you want to install JDK, I don't get why it installs 2 seperate packages.

In summary, to me, it seems logical to remove the JDK's JRE, ONLY when installing the JDK when JRE already exists on the system. Downloading 2 seperate packages is pointless, when it's unnecessary.

Last edited by steven (2007-07-25 12:18:21)

Offline

#6 2007-07-25 12:24:23

JGC
Developer
Registered: 2003-12-03
Posts: 1,664

Re: Why does jdk depend on jre ?

The JDK would be double sized when the JRE was included. We would split it up anyways, so I see no point in having two java packages:

jdk -> provides=jre, conflicts=jre
jre -> just jre

That situation would:
- force us to upload two packages which contain duplicate files (so we upload 30MB too much, say hello to our amd64 dev with 384/64 line)
- force a user who has jre but wants jdk to delete his old jre, download the same thing again and install it as part of jdk.

Offline

#7 2007-07-25 12:56:03

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Why does jdk depend on jre ?

steven wrote:

If I want to install just jdk for development, I shouldn't need the jre at all. I downloaded 60MB instead of 30MB. I was simply curious why both were installed.

Could you explain why you shouldn't need the jre for development ?
You're so good that you don't even need to run the programs you write smile
I would think that the big majority of users who install the jdk want the jre as well.
But maybe I'm missing something, please enlighten me then.

In any cases, It's much more usual to use jre alone than jdk alone.
And I assume that's why Sun provides either jre, or jdk+jre.


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#8 2007-07-25 12:59:02

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: Why does jdk depend on jre ?

JGC wrote:

The JDK would be double sized when the JRE was included. We would split it up anyways, so I see no point in having two java packages:

jdk -> provides=jre, conflicts=jre
jre -> just jre

That situation would:
- force us to upload two packages which contain duplicate files (so we upload 30MB too much, say hello to our amd64 dev with 384/64 line)
- force a user who has jre but wants jdk to delete his old jre, download the same thing again and install it as part of jdk.

Indeed, that would be stupid. That's what I first understood, but finally, that's not what he wants.
He would like to have the current jdk package (not including jre) not depending on jre.
So that jdk could be installed alone. I failed to see the point of this, but well..


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#9 2007-07-25 19:22:11

steven
Member
Registered: 2007-07-17
Posts: 56

Re: Why does jdk depend on jre ?

No, you misunderstand...

I thought I explained it quite clearly. I'll go point by point:

* JDK comes with JRE functionality built in (one single package)
* I want just JDK installed via pacman, not two seperate packages (JRE and JDK)
* Pacman installs 2 seperate packages!

It's simple, the JDK has the runtime environment built in, so there's no need to install both the jdk and the jre. If someone is in the scenario you describe whereby, they have JRE already installed and decide to install the JDK afterwards, then pacman should be able to detect the existing jre and simply remove the runtime environment from the JDK package (which currently happens). I'm simply saying, if someone only wants JDK, don't install 2 seperate packages as the JDK includes JRE anyway.

Surely in the PKGBUILD or install files in pacman, it can make checks for a pre-existing JRE install (when installing JDK) and only remove the runtime from the JDK, but if there's no pre-existing JRE install, then ONLY install JDK, without removing the runtime.

My Internet connection is super, so I don't have a big issue with bandwidth, but surely it's better for your mirrors and users who don't have super connections. It also just makes more sense. It seems completely daft to download 60 megs of 2 packages, then delete jre from the jdk and install it seperately. It's bizarre.

Last edited by steven (2007-07-25 19:24:55)

Offline

#10 2007-07-25 19:31:16

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Why does jdk depend on jre ?

steven wrote:

It's simple, the JDK has the runtime environment built in, so there's no need to install both the jdk and the jre. If someone is in the scenario you describe whereby, they have JRE already installed and decide to install the JDK afterwards, then pacman should be able to detect the existing jre and simply remove the runtime environment from the JDK package (which currently happens). I'm simply saying, if someone only wants JDK, don't install 2 seperate packages as the JDK includes JRE anyway.

Surely in the PKGBUILD or install files in pacman, it can make checks for a pre-existing JRE install (when installing JDK) and only remove the runtime from the JDK, but if there's no pre-existing JRE install, then ONLY install JDK, without removing the runtime.

My Internet connection is super, so I don't have a big issue with bandwidth, but surely it's better for your mirrors and users who don't have super connections. It also just makes more sense. It seems completely daft to download 60 megs of 2 packages, then delete jre from the jdk and install it seperately. It's bizarre.

I don't think you understand how our packaging system works... the jdk we provide, that users download from our repos, does not have the "included" jre - users don't download the jre twice.  In your suggestion, they would download the jre twice (once when they install jre, and once again later when they install jdk).

Besides that matter, it is not a simple thing to dynamically alter the contents of packages at install time - we provide binary packages, pre-built, and the file list of a package is essentially exactly equal to the contents of the tarball you download.

The way we have it now, only one package in our repos contains the jre, and that's the jre package.  I don't see why you'd rather your package manager sees one package instead of two - you have no duplicate files on your system, and downloaded no extra data (since the binary jdk package doesn't contain the jre at all).

Offline

#11 2007-07-25 19:38:17

steven
Member
Registered: 2007-07-17
Posts: 56

Re: Why does jdk depend on jre ?

Cerebral wrote:
steven wrote:

It's simple, the JDK has the runtime environment built in, so there's no need to install both the jdk and the jre. If someone is in the scenario you describe whereby, they have JRE already installed and decide to install the JDK afterwards, then pacman should be able to detect the existing jre and simply remove the runtime environment from the JDK package (which currently happens). I'm simply saying, if someone only wants JDK, don't install 2 seperate packages as the JDK includes JRE anyway.

Surely in the PKGBUILD or install files in pacman, it can make checks for a pre-existing JRE install (when installing JDK) and only remove the runtime from the JDK, but if there's no pre-existing JRE install, then ONLY install JDK, without removing the runtime.

My Internet connection is super, so I don't have a big issue with bandwidth, but surely it's better for your mirrors and users who don't have super connections. It also just makes more sense. It seems completely daft to download 60 megs of 2 packages, then delete jre from the jdk and install it seperately. It's bizarre.

I don't think you understand how our packaging system works... the jdk we provide, that users download from our repos, does not have the "included" jre - users don't download the jre twice.  In your suggestion, they would download the jre twice (once when they install jre, and once again later when they install jdk).

Besides that matter, it is not a simple thing to dynamically alter the contents of packages at install time - we provide binary packages, pre-built, and the file list of a package is essentially exactly equal to the contents of the tarball you download.

The way we have it now, only one package in our repos contains the jre, and that's the jre package.  I don't see why you'd rather your package manager sees one package instead of two - you have no duplicate files on your system, and downloaded no extra data (since the binary jdk package doesn't contain the jre at all).

Ah ok I see, I had the wrong idea.

AndyRTR wrote:

check our jdk PKGBUILD and you will find a line   rm -rf linux-jdk/jre wink

This quote gave me the idea that it's download, but then the built in functionality is removed before it's actually installed. Are you saying that this isn't the case?

shining wrote:

You're so good that you don't even need to run the programs you write

I wish wink

Offline

#12 2007-07-25 19:42:41

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Why does jdk depend on jre ?

steven wrote:
AndyRTR wrote:

check our jdk PKGBUILD and you will find a line   rm -rf linux-jdk/jre wink

This quote gave me the idea that it's download, but then the built in functionality is removed before it's actually installed. Are you saying that this isn't the case?

Correct - the PKGBUILD is the file that's sourced at build-time, not install-time.  This is all handled ahead-of-time by the package maintainer, so the users shouldn't have to worry about it. wink

Offline

#13 2007-07-25 21:54:09

nikron
Member
Registered: 2007-05-15
Posts: 130

Re: Why does jdk depend on jre ?

Seems like the perfect setup to me.  Obviously, most people just want the jre.  But, if you want the jdk, you need both.  Sure, jdk could conflict with jre.  But, this way if someone already has the jre he/she doesn't have to re download it again.

Offline

#14 2007-07-25 22:48:28

steven
Member
Registered: 2007-07-17
Posts: 56

Re: Why does jdk depend on jre ?

Cerebral wrote:
steven wrote:
AndyRTR wrote:

check our jdk PKGBUILD and you will find a line   rm -rf linux-jdk/jre wink

This quote gave me the idea that it's download, but then the built in functionality is removed before it's actually installed. Are you saying that this isn't the case?

Correct - the PKGBUILD is the file that's sourced at build-time, not install-time.  This is all handled ahead-of-time by the package maintainer, so the users shouldn't have to worry about it. wink

Ok, now I'm confused. tongue

Admittedly, I'm new to both Arch and Pacman. I figured that the PKGBUILD downloads the file, then works it magic locally (similar abs), which is why the info I quoted made sense to me. I figured it would download the jdk from sun (or your repo's, but still the standard jdk release), untar it, delete the jre subdirectory from jdk and then install as normal.

Is this wrong?

Offline

#15 2007-07-26 04:17:29

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Why does jdk depend on jre ?

steven wrote:

Admittedly, I'm new to both Arch and Pacman. I figured that the PKGBUILD downloads the file, then works it magic locally (similar abs), which is why the info I quoted made sense to me. I figured it would download the jdk from sun (or your repo's, but still the standard jdk release), untar it, delete the jre subdirectory from jdk and then install as normal.

Is this wrong?

Well.... that's kind of what the PKGBUILD does.  Here's how it works for the official repos:

1) A dev (me, say), writes a PKGBUILD for a package.
2) Same dev runs makepkg in the same directory as the PKGBUILD file.
3) makepkg sources the PKGBUILD, grabs the sources from the web, and builds the application, placing the resultant fully-built package into a tarball with the extension .pkg.tar.gz  - this .pkg.tar.gz will already have jre removed, in the case of the jdk.
4) developer uploads the .pkg.tar.gz to the repos
5) every user in the existence of ever downloads the .pkg.tar.gz, which (oversimplified) is just untarred into the users root.

If you want to build all of your packages all by yourself, then yes, you'd need to do extra downloading to get jre sources then jdk+jre sources.  However, if you were building all your packages on your own, you could easily edit the jdk pkgbuild to keep the jre stuff, add provides=(jre) and conflicts=(jre) into the pkgbuild before you built the package, and you're good to go.

Offline

#16 2007-07-26 04:37:59

denisfalqueto
Member
From: ES, Brazil
Registered: 2006-03-24
Posts: 197

Re: Why does jdk depend on jre ?

steven wrote:

Admittedly, I'm new to both Arch and Pacman. I figured that the PKGBUILD downloads the file, then works it magic locally (similar abs), which is why the info I quoted made sense to me. I figured it would download the jdk from sun (or your repo's, but still the standard jdk release), untar it, delete the jre subdirectory from jdk and then install as normal.

Is this wrong?

Yes, it is tongue. You shouldn't need to build the jre or jdk packages. They are not compiled (at leas until the jre and jdk are released in source form), so the package you will generate is exactly the same that the maintainer generated. So when you tell

pacman -S jdk

you are asking to pacman to fetch the package generated by the manteiner of the package, not the original jdk from Sun. The PKGBUILD is used by the manteiner to make the binary file that you will install with pacman. You should read this to understand the role of the PKGBUILD in the Arch.

HTH


Satisfied users don't rant, so you'll never know how many of us there are.

Offline

#17 2007-07-26 09:49:22

steven
Member
Registered: 2007-07-17
Posts: 56

Re: Why does jdk depend on jre ?

Cerebral wrote:
steven wrote:

Admittedly, I'm new to both Arch and Pacman. I figured that the PKGBUILD downloads the file, then works it magic locally (similar abs), which is why the info I quoted made sense to me. I figured it would download the jdk from sun (or your repo's, but still the standard jdk release), untar it, delete the jre subdirectory from jdk and then install as normal.

Is this wrong?

Well.... that's kind of what the PKGBUILD does.  Here's how it works for the official repos:

1) A dev (me, say), writes a PKGBUILD for a package.
2) Same dev runs makepkg in the same directory as the PKGBUILD file.
3) makepkg sources the PKGBUILD, grabs the sources from the web, and builds the application, placing the resultant fully-built package into a tarball with the extension .pkg.tar.gz  - this .pkg.tar.gz will already have jre removed, in the case of the jdk.
4) developer uploads the .pkg.tar.gz to the repos
5) every user in the existence of ever downloads the .pkg.tar.gz, which (oversimplified) is just untarred into the users root.

If you want to build all of your packages all by yourself, then yes, you'd need to do extra downloading to get jre sources then jdk+jre sources.  However, if you were building all your packages on your own, you could easily edit the jdk pkgbuild to keep the jre stuff, add provides=(jre) and conflicts=(jre) into the pkgbuild before you built the package, and you're good to go.

Ok, thank for the more in-depth explanation... I don't know why, but I had it in my head that it downloaded a binary package then removed the jre directory locally. It makes much more sense now anyway. Binary package management is something I need to get used to, you have to build the packages as generic and wide as possible, to cover most scenarios.

Thanks. =]

Offline

Board footer

Powered by FluxBB