3

I don't use openjdk environment, and I've got oracle java installed, then linked the java / javac binaries to /usr/bin.

Now when I build packages that requires java-runtime package, I had to edit the PKGBUILD everytime to strip off the dependency of that package.

So, can I insert a record somewhere, so that make pacman believe java-runtime is installed already?

EDIT

I didn't use any package to install oracle java, I just extracted it some where then linked the binaries to $PATH

daisy
  • 54,555
  • Doas archlinux support a kind of virtual packages like others distros do? That could be a solution. For example, in my gentoo, there is a package called virtual/jre I can install so that my system know I do have a jre installed whichever implementation I choose. – lgeorget Apr 25 '13 at 02:44
  • 2
    lgeorget - Yes, by using the provides PKGBUILD directive. – Chris Down Apr 25 '13 at 06:14
  • 1
    If you mean the jre package by oracle java then please provide more information because it does provide java-runtime. It also provides scripts for /etc/profile.d that automatically add the java folder to your $PATH, set $JAVA_HOME and whatnot making the manual linking to /usr/bin unnecessary. – Wieland Apr 25 '13 at 08:29
  • @Wieland java is working fine; and see my update – daisy Apr 25 '13 at 09:32
  • It's possible to create PKGBUILDs that produce empty packages (simply change the package function to just /bin/true) but it is not a good idea. Unless you have a very good reason not to, you should really install a package for the JRE and be done with it. – Wieland Apr 25 '13 at 12:58

2 Answers2

2

In a similar situation on Ubuntu, I just installed the (repeatedly) required package and removed the individual files afterwards, based on list of installed file the package manager told me about. Just make sure nothing of your own installation gets overwritten.

The one thing I found over time is that some package use their installation scripts to generate additional data those are of course not in the package's file list.

Anthon
  • 79,293
  • 1
    Installing a package and manually removing its files is really not a solution to anything because you're basically doing things behind your package managers back that shouldn't be done. – Wieland Apr 25 '13 at 08:31
  • 2
    The OP probably already went behind the package managers back by installing a Java without that install telling the package managers that it fulfilled the java-runtime prerequisite. (Could of course be that that package was wrong but I assume that he installed from source). – Anthon Apr 25 '13 at 08:54
2

I am using Arch linux: I generated (then deleted) a PKGBUILD file describing a package named "fake-java" with no files which provides "java-environment=7". I ran updpkgsums, makepkg, then on the newly-generated tar.xz file, pacman -U.

So far it has worked.

  • I'd like to comment that now I use the "jdk" package from the AUR. My solution above is appropriate if you don't want to install Java, but if you do have some java installation you should put it into the package. – Score_Under Jul 01 '15 at 21:12