You are not logged in.

#1 2014-10-13 00:23:42

Phreakazoid
Member
Registered: 2009-03-07
Posts: 8

"Official ArchLinux" way to override version with java-runtime-common

Since the latest update to java-runtime-common it's no longer possible to override the default Java version using the JAVA_HOME environment variable. This means that to use a different version you have two options:

* Change the default version each time you want a different version, thus forcing every Java app to use that other version
* Edit the PATH such that the $JAVA_HOME/bin of the desired overriding Java environment is ahead of the wrapper, thus bypassing java-runtime-common altogether

Is there some "official" way to run with the non-default version while still using the ARchLinux official tool?
How should this be implemented in packages/AUR that require a specific version or versions of the JRE/JDK?

Thanks!

Offline

#2 2014-10-13 01:05:36

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,403

Re: "Official ArchLinux" way to override version with java-runtime-common

Sure, it's a command called archlinux-java


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2014-10-13 02:05:10

Phreakazoid
Member
Registered: 2009-03-07
Posts: 8

Re: "Official ArchLinux" way to override version with java-runtime-common

nomorewindows wrote:

Sure, it's a command called archlinux-java

I already know about that command, it's nothing to do with running java in a particular version as a once-off thing. It's used to set the default java version, and to retrieve a list of versions.

To explain again, I need to have a default version set, but sometimes I want to run a different version. Previously I could just do something like this:

env JAVA_HOME=/usr/lib/jvm/java-7-oracle INSERT_COMMAND_HERE

Now that doesn't work anymore. How are we "officially" meant to be doing it now, as the only way I can see now is to just bypass the wrapper by inserting the new JAVA_HOME in the PATH before everything else.

Last edited by Phreakazoid (2014-10-13 02:05:24)

Offline

#4 2014-10-13 02:32:38

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,403

Re: "Official ArchLinux" way to override version with java-runtime-common

You may have more luck using jre/jdk from the AUR.  I had some troubles with the javaws/web start icedtea-web.  I couldn't use wpad and configured from firefox for proxy.  It wanted explicit proxy  definitions.  Little things like that may break what you are trying to do.  Temporarily setting the variable in front of the command is perfectly legit, but it may just be inconvenient to type that everytime.  Although it doesn't help running things, eclipse would allow you to select your preferred java environment to work with while building.  It probably had to do something similar to get that to work.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2014-10-13 02:41:44

Phreakazoid
Member
Registered: 2009-03-07
Posts: 8

Re: "Official ArchLinux" way to override version with java-runtime-common

Thanks! I figured there was probably some way built in to the system since it calls the currently set JVM the "default", which implies it's what starts if you don't tell it to be something else, rather than "if you use the wrapper you can only use this one". Setting JAVA_HOME and PATH manually will have to do for now, unless there is a better way.

Offline

#6 2014-10-13 11:28:52

Wikimig
Developer
From: France
Registered: 2004-12-10
Posts: 77
Website

Re: "Official ArchLinux" way to override version with java-runtime-common

Forcing JAVA_HOME is unfortunately not supported any more because it did not play well with several build and run scripts. Java apps need a script to run their "java OPTS": these scripts usually allow you to define your own JAVA_HOME either by hande or with a "--with-jdkpath" like option. There is unfortunately no official means rather than these plain Java one.

nomorewindows wrote:

You may have more luck using jre/jdk from the AUR.

People are very quick to switching to Java envs from AUR for (in my opinion) very bad reasons and I think this is one. You have absolutely no reason to quit using OpenJDK from extra!

Offline

#7 2014-10-13 12:56:20

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,403

Re: "Official ArchLinux" way to override version with java-runtime-common

The duhpendency change for java-common has fussed up jdk.  Even though that would be easy to fix.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#8 2015-03-25 14:02:18

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,403

Re: "Official ArchLinux" way to override version with java-runtime-common

I just found the rhino package, so that my proxy settings don't confuse openjdk/jre.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

Board footer

Powered by FluxBB