Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#41603 - [netbeans] Doesn't work by default with jdk8-openjdk

Attached to Project: Community Packages
Opened by Peter Weber (hoschi) - Monday, 18 August 2014, 09:28 GMT
Last edited by Alexander F. Rødseth (xyproto) - Friday, 17 October 2014, 13:35 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Alexander F. Rødseth (xyproto)
Guillaume ALAUX (galaux)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Hello!

Description:
NetBeans doesn't work by default if (only) jdk8-openjdk is installed. I installed jdk8-openjdk and removed jdk7-openjdk as instructed by the wiki and used the script archlinux-java to switch the Java-Environment, as well as the fix option. During startup NetBeans complains about the missing JDK (see attached screenshot). Furthermore the JVM complains about the usage of memory-options through NetBeans which are not unsupported.

$ netbeans
OpenJDK 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: ignoring option PermSize=32m; support was removed in 8.0

Workaround:
Use NetBeans with the option "--jdkhome" and the parameter "/usr/lib/jvm/java-default-runtime" or "/usr/lib/jvm/java-8-openjdk"
Alternative:
Edit the global netbeans.conf file stored under /usr/share/netbeans/etc/netbeans.conf and add the line:
netbeans_jdkhome="/usr/lib/jvm/java-default-runtime" or
netbeans_jdkhome="/usr/lib/jvm/java-8-openjdk"

Possible cause:
As far as I know /usr/bin/netbeans should detect and use the correct JDK and is also responsible for the memory-options which should not applied anymore.

Additional info:
* package version: netbeans 8.0-1
* see attached screenshot (clean test user)


Steps to reproduce:
1. Install jdk8-openjdk
2. If installed: remove jdk7-openjdk
3. Set java-environment with archlinux-java
4. Execute netbeans
This task depends upon

Closed by  Alexander F. Rødseth (xyproto)
Friday, 17 October 2014, 13:35 GMT
Reason for closing:  Fixed
Comment by Ant (Ant1) - Monday, 18 August 2014, 15:33 GMT
Confirmed here too. It occurs with OpenJdk 7 as well.
Comment by Guillaume ALAUX (galaux) - Monday, 18 August 2014, 16:14 GMT
Just for the record, I had this issue and cannot reproduce it now that I have removed my ~/.netbeans directory.

Could you please provide output of the following:

$ grep -ir home ~/.netbeans

As explained in this thread [0], could you please (first backup then) remove your ~/.netbeans directory

[0] https://bbs.archlinux.org/viewtopic.php?pid=1448000
Comment by Peter Weber (hoschi) - Tuesday, 19 August 2014, 08:12 GMT
You're changing your comment to fast!

1. Adding
netbeans_jdkhome="{$JAVA_HOME}"
doesn't work.

2. You mentioned the lack of JDK-8-Support in NetBeans, but the referenced WIKI-Page was last edited in 2013


3. Attached grep -ir home ~/.netbeans
3.1 Installed both JDK7 and JDK8
3.2 Deleted ~/.netbeans
3.3 Execute netbeans
3.4 Activate JavaSE-Plugin (preinstalled)
3.5 Exit NetBeans

Comment by Guillaume ALAUX (galaux) - Tuesday, 19 August 2014, 08:33 GMT
Yes I don't know what went on with my comments here: I see my old one. Anyway.

1. What about adding directly:
netbeans_jdkhome="/usr/lib/jvm/java-default-runtime"

2. What do you mean?
Comment by Peter Weber (hoschi) - Tuesday, 19 August 2014, 08:39 GMT
I've also edited my post above you. But now let us keep linear ;-)

1. That works, I've already done that before (see original report)
2. See edit above
Comment by Guillaume ALAUX (galaux) - Tuesday, 19 August 2014, 09:39 GMT
> 1. That works, I've already done that before (see original report)
Oh right, my bad.
@xyproto: then I guess you can go ahead and add the following to /usr/share/netbeans/etc/netbeans.conf :
netbeans_jdkhome="/usr/lib/jvm/java-default-runtime"

2. Ok. I will let Xyproto see about that.

3. File is empty. Nevermind, it turns out we do not need it.
Comment by Guillaume ALAUX (galaux) - Tuesday, 19 August 2014, 09:43 GMT
So my old comment that actually disappeared was about /usr/share/netbeans/platform/lib/nbexec that (in our case) is passed an empty "--jdkhome". This makes this script try to manually guess where the JVM is installed. It fails in doing so without even trying to see what JAVA_HOME is set to.
Here is a bug report about that opened in 2013 (though different use case)
https://netbeans.org/bugzilla/show_bug.cgi?id=235954
I will see if upstream would consider a patch for this. In the meantime I think setting netbeans_jdkhome as previously stated is a good solution.
Comment by Peter Weber (hoschi) - Tuesday, 19 August 2014, 10:02 GMT
Sorry for the empty file, I've attached it now.
I will add a comment on the wiki for this issue in the meantime today afternoon (CEST).

Thank you

// done
https://wiki.archlinux.org/index.php/Netbeans#Missing_JDK
Comment by Peter Weber (hoschi) - Thursday, 21 August 2014, 09:33 GMT
Question:
Shouldn't we provide an already modified "/usr/share/netbeans/etc/netbeans.conf" with "netbeans_jdkhome="/usr/lib/jvm/java-default-runtime"", as this modification is now mandatory?
Comment by Guillaume ALAUX (galaux) - Thursday, 21 August 2014, 10:40 GMT
That's what I am suggesting yes.
Comment by Alexander F. Rødseth (xyproto) - Sunday, 24 August 2014, 11:07 GMT
Hi, thanks for reporting this. I will look into the problem and most likely change netbeans_jdkhome in netbeans.conf, as suggested.
Comment by Alexander F. Rødseth (xyproto) - Sunday, 24 August 2014, 16:57 GMT
Netbeans has updated the available download for version 8.0.
After following the steps to reproduce, it worked perfectly fine here.
Updating the netbeans package to "netbeans-8.0-2" (internal netbeans version 201403101706).

Please check if it is working correctly and report back. Thanks.
Comment by Peter Weber (hoschi) - Monday, 25 August 2014, 07:37 GMT
I've updated with pacman to netbeans-8.0-2 but I still need the workaround in the netbeans.conf.

Comment by Peter Weber (hoschi) - Monday, 25 August 2014, 09:28 GMT
I've updated with pacman to netbeans-8.0-2 but I still need the workaround in the netbeans.conf.

Comment by Guillaume ALAUX (galaux) - Monday, 25 August 2014, 12:06 GMT
As with previous version: netbeans starts fine here. Still, /usr/share/netbeans/platform/lib/nbexec has the wrong $jdkhome. I can see the issue when trying to activate "java web and EE" plugin.
Comment by Alexander F. Rødseth (xyproto) - Wednesday, 27 August 2014, 18:31 GMT
Got you. Will update the package to include the workaround as well.
Comment by Peter Weber (hoschi) - Wednesday, 03 September 2014, 11:28 GMT
I switched jdkhome now to "/usr/lib/jvm/default", looks like this is now the correct link? The old one still works.
Comment by Guillaume ALAUX (galaux) - Wednesday, 03 September 2014, 12:12 GMT
True. Last "java-common" provides link "default" to a valid JVM and link "default-runtime" to a valid JRE. This was required by software (IcedTea-web for instance). The old link "java-default-runtime" still points at "default" (I plan on keeping it for a couple of weeks) but from now on we should rely on "default".

@xyproto: you will need to use
netbeans_jdkhome="/usr/lib/jvm/default" in /usr/share/netbeans/etc/netbeans.conf
Comment by Tomasz Kołodziejski (neo) - Sunday, 07 September 2014, 17:51 GMT
In my case I had to set:
netbeans_jdkhome="/usr/lib/jvm/java-7-openjdk"

Setting it just "/usr/lib/jvm/default" did not work.
Comment by Guillaume ALAUX (galaux) - Monday, 08 September 2014, 19:27 GMT
Well then I guess this is an issue with your /usr/lib/jvm/default not pointing at the right JDK. Anyway, with no log nor error message no one can say!
Comment by Tomasz Kołodziejski (neo) - Tuesday, 09 September 2014, 03:34 GMT
I'm sorry. It's netbeans_jdkhome="/usr/lib/jvm/java-default-runtime" that didn't work. It was suggested on wiki (https://wiki.archlinux.org/index.php/netbeans)
Comment by Guillaume ALAUX (galaux) - Tuesday, 09 September 2014, 07:55 GMT
Ok. This is now fixed: wiki now says "/usr/lib/jvm/default"
Comment by Guillaume ALAUX (galaux) - Tuesday, 09 September 2014, 07:59 GMT
@xyproto: netbeans-8.0-2 still ships netbeans.conf with jdkhome commented out. Is there any reason to hold this fix?
Comment by Alexander F. Rødseth (xyproto) - Wednesday, 10 September 2014, 09:47 GMT
No other reason than unusually busy weeks and traveling for a wedding this weekend. Looking at it now.
Comment by Alexander F. Rødseth (xyproto) - Wednesday, 10 September 2014, 10:17 GMT
Fixed. The updated package will appear in [community] shortly.
Comment by Guillaume ALAUX (galaux) - Sunday, 12 October 2014, 20:58 GMT
@Xyproto: the issue for this bug came from package "java-common". Its replacements now do not use the "java wrapper" script that induced this error. I have checked and you could safely get rid of the "netbeans_jdkhome" line here:

https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/netbeans#n32
Comment by Alexander F. Rødseth (xyproto) - Friday, 17 October 2014, 09:57 GMT
Thanks for testing.

I removed the config line for the latest release of the netbeans package. Closing this one.

Loading...