netbeans non-functional: 'invalid flag -g:'

Bug #401589 reported by Jonathan Nielsen
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
netbeans (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: netbeans

Apparent regression in interaction between netbeans and the jdk (I have sun-java6-jdk installed) in Karmic

Anytime netbeans from Karmic task-scans or is told to "Run Main Project", it fails with error 'invalid flag -g:' This did not happen in Jaunty, and has now happened to me both on upgrade from Jaunty and fresh install of Karmic Alpha 2 with all updates run (and fresh home directory).

Can't find anything in settings that would influence this.

Package manager shows netbeans version 6.5-0ubuntu3, sun-java6-jdk version 6-14-1

Stack trace follows (though not very helpful):
java.lang.IllegalArgumentException: invalid flag: -g:
 at com.sun.tools.javac.api.JavacTool.processOptions(JavacTool.java:250)
 at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:221)
 at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:67)
 at org.netbeans.api.java.source.JavaSource.createJavacTask(Unknown Source)
 at org.netbeans.api.java.source.JavaSource.createJavacTask(Unknown Source)
 at org.netbeans.api.java.source.CompilationInfoImpl.getJavacTask(Unknown Source)
 at org.netbeans.api.java.source.CompilationInfo.getElements(Unknown Source)
 at org.netbeans.api.java.source.SourceUtils$5.run(Unknown Source)
 at org.netbeans.api.java.source.SourceUtils$5.run(Unknown Source)
 at org.netbeans.api.java.source.JavaSource.runUserActionTaskImpl(Unknown Source)
 at org.netbeans.api.java.source.JavaSource.runUserActionTask(Unknown Source)
 at org.netbeans.api.java.source.SourceUtils.isMainClass(Unknown Source)
 at org.netbeans.modules.java.j2seproject.J2SEProjectUtil.isMainClass(Unknown Source)
 at org.netbeans.modules.java.j2seproject.J2SEActionProvider.isSetMainClass(Unknown Source)
 at org.netbeans.modules.java.j2seproject.J2SEActionProvider.getTargetNames(Unknown Source)
 at org.netbeans.modules.java.j2seproject.J2SEActionProvider$4.run(Unknown Source)
 at org.netbeans.api.java.source.ui.ScanDialog.runWhenScanFinished(Unknown Source)
 at org.netbeans.modules.java.j2seproject.J2SEActionProvider.invokeAction(Unknown Source)
 at org.netbeans.modules.project.ui.actions.MainProjectAction.actionPerformed(Unknown Source)
 at org.netbeans.modules.project.ui.actions.LookupSensitiveAction.actionPerformed(Unknown Source)
 at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012)
 at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335)
 at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404)
 at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
 at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:253)
 at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
 at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
 at java.awt.Component.processMouseEvent(Component.java:6108)
 at javax.swing.JComponent.processMouseEvent(JComponent.java:3276)
 at java.awt.Component.processEvent(Component.java:5873)
 at java.awt.Container.processEvent(Container.java:2105)
 at java.awt.Component.dispatchEventImpl(Component.java:4469)
 at java.awt.Container.dispatchEventImpl(Container.java:2163)
 at java.awt.Component.dispatchEvent(Component.java:4295)
 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4461)
 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4125)
 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4055)
 at java.awt.Container.dispatchEventImpl(Container.java:2149)
 at java.awt.Window.dispatchEventImpl(Window.java:2478)
 at java.awt.Component.dispatchEvent(Component.java:4295)
[catch] at java.awt.EventQueue.dispatchEvent(EventQueue.java:604)
 at org.netbeans.core.TimableEventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)

Tags: java netbeans
Revision history for this message
Marek Slama (mslama-email) wrote :

Look at IDE log what JDK is used to run IDE. Also I assume you did not change JDK platform for your project ie. you use the same JDK to build your project.

Use View -> IDE Log from main menu. You should see something like this at beginning of IDE log:
  Operating System = Linux version 2.6.28-14-generic running on i386
  Java; VM; Vendor = 1.6.0_15; Java HotSpot(TM) Client VM 14.1-b02; Sun Microsystems Inc.
  Runtime = Java(TM) SE Runtime Environment 1.6.0_15-b03
  Java Home = /usr/java/jdk1.6.0_15/jre

It is find out what JDK is used.

Revision history for this message
Jonathan Nielsen (jmnet) wrote :

Here's the top of the IDE log, the only 'strange' thing is it says OpenJDK where I think the old one was the normal sun JDK, but it still should work as far as I know.
-------------------------------------------------------------------------------
>Log Session: Monday, July 20, 2009 12:30:12 AM PDT
>System Info:
  Product Version = NetBeans IDE 6.5 (Build 090407)
  Operating System = Linux version 2.6.31-3-generic running on i386
  Java; VM; Vendor = 1.6.0_0; OpenJDK Client VM 14.0-b15; Sun Microsystems Inc.
  Runtime = OpenJDK Runtime Environment 1.6.0_0-b16
  Java Home = /usr/lib/jvm/java-6-openjdk/jre

Revision history for this message
Jonathan Nielsen (jmnet) wrote :

Sorry for another post so quickly, but I should mention: no I haven't changed JDKs on individual projects, this happens on both 'loaded' old projects and new projects, and this is the only jdk installed on the system.

Revision history for this message
Thorb (marcospringer) wrote :

Hello, i've been digging through the update history of my system.
This morning i've updated it and since this morning i've been getting this error too.

I've found the following:
[UPGRADE] libnb-javaparser-java 6.5-0ubuntu1 -> 6.7-0ubuntu1

I just manually installed a new netbeans 6.7 (without importing settings from 6.5 since i've read there were some problems to that as well).

Now i can continue my work ;)

I guess that if you change that libnb-javaparser-java back to version 6.5 it should work for the default install of netbeans-6.5 again, that is if you installed it through apt-get/aptitude/adept/syntaptic whatever.

Revision history for this message
Jonathan Nielsen (jmnet) wrote :

OK, well it sounds as though they might be in process up updating netbeans on karmic to 6.7 if theres a library that was updated, so either the library needs to be reverted to 6.5 or the whole thing needs to go up to 6.7 before it'll work :)

Out of curiosity I tried reinstalling sun-java6-jdk and running update-alternatives to change all java-related commands to the sun-java, and then setting jdk-home in netbeans.conf to the sun java, but still the same error. Thanks for finding the library update, I'll try reverting it on my computer.

Revision history for this message
Jonathan Nielsen (jmnet) wrote :

OK, that is indeed the problem... used http://us.archive.ubuntu.com/ubuntu/pool/universe/libn/libnb-javaparser-java/libnb-javaparser-java_6.5-0ubuntu1_all.deb as a drop-in downgrade to the 6.7 version and now everything works as expected. Should have checked for that myself, bleh.

Could we remove the 6.7 libnb-javaparser from the repos, unless the full 6.7 netbeans is going to hit the repos soon?

Revision history for this message
Yulia Novozhilova (yulia-novozhilova) wrote :

Hi,
Thank you for report.
Actually, netbeans 6.7 is going to hit the repos soon. But it is impossible to do all the things simultaneously. There are a lot of package updates as well as a new package upload (is waiting for sponsors on REVU). So I don't think it is a good idea to revert libraries. Anyway I'll try to do something with this problem (may be to update netbeans-6.5 dependencies somehow. Need to investigate).

Changed in netbeans (Ubuntu):
status: New → Confirmed
Revision history for this message
Jonathan Nielsen (jmnet) wrote :

It appears that all of the netbeans 6.7 packages have made it through (I just removed my separate install of netbeans and got the repo ones, seems to work fine) so I guess this is fixed now.

Changed in netbeans (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.