2013/5/10 Daniel Dickman <[email protected]>
> >
> >> Since you are patching bin/intellij.sh anyway, why not just rip out all
> >> the JAVA_HOME/JDK-HOME goo and use javaPathHelper like all the other
> Java
> >> ports do?
> >
> > Done; files/idea wrapper is not needed anymore then, so I zapped it. This
> > required adding a patch for readlink call, though. Thank you for input.
> >
> > Is it okay now?
> >
>
> There is a reason why intellij does not use javaPathHelper (JPH). We
> had a discussion about this off-list a while back. What happened was
> that ian@ discovered that javaPathHellper will use the JDK in your
> path instead of the JDK that you're specifying in the port Makefile.
> So at the time JDK 1.6 was the only JDK that would work with intellij
> and he had JDK 1.7 in his path ahead of JDK 1.6. This resulted in
> intellij not being to run because JPH was picking up the wrong JDK at
> runtime.
>
> In this case, if we're switching to only support JDK 1.7, but if I
> have JDK 1.6 in my path ahead of 1.7, I believe we will re-create that
> same problem.
>
> Here is what kurt@ had to say at the time:
>
> "there is nothing wrong with devel/intellij not using javaPathHelper since
> it only works with one JDK. javaPathHelper is intended to help with ports
> that
> can run with multiple JDK's. Its use for intellij is overkill, IMO."
>
> I think maybe we should document why intellij does not use JPH because
> this one is not at all obvious.
>
I think there is another approach: idea.sh initially supports IDEA_JDK
envvar. Thus we could have the following in patched idea.sh:
JDK=${IDEA_JDK:-`javaPathHelper -h intellij`}
This way we'll have both standard way of defining JDK and option to set JDK
personally for IDEA. What do you think?
--
WBR,
Vadim Zhukov