17

I've googled around and it seems that I'm not the only one with the problem, however I couldn't find the solution. Maybe someone around here has figured it out.

The problem is that netbeans.exe is actually a stub which is calling javaw.exe. When I try to pin the NetBeans process to the taskbar I actually pin "Java(TM) Platform SE Binary". That changes the icon and the pin doesn't work.

The funny thing is that it works on another machine. I don't know whether it's because it's a different version of NetBeans, or a different version of Java.

Has anyone figured this out?

Added: I know this is sort of not programming related; on the other hand there are plenty of topics around here about how to better your programming environment, and this one is no worse than those.

Oh, and btw - Windows 7 Enterprise x64; Java JDK 1.6.17; Netbeans 6.8

Bobby
  • 9,032
Vilx-
  • 4,237

7 Answers7

16

Problem found, although not exactly solved. Here's the description:

Netbeans.exe is a custom launcher written in C++. It's a 32-bit module. When it loads, it first tries to load Java as a DLL into itself and then start NetBeans. However, if the Java runtime is 64-bit, it cannot do that because a 32-bit module cannot load a 64-bit module and vice-versa. Thus it falls back to starting Java as a separate process (javaw.exe) with the right parameters.

On the machine where "everything works" I had installed a 32-bit Java runtime, but on the "faulty machine" I had installed the full 64-bit JDK.

So in essence I see three possible solutions:

  • Uninstall the 64-bit Java and install 32-bit;
  • Try to compile the launcher as a 64-bit module (who knows if that will work, probably not without modifications);
  • Make a shortcut directly to javaw.exe with all the right parameters (those can be found in the Task Manager).
Vilx-
  • 4,237
12

You can pin NetBeans to the taskbar and take advantage of other Windows 7 features by using free SevenBeans module.

torn
  • 221
3

Problem found and solved.

It depends on which NetBeans executable you run in combination with the Java VM bitsize installed:

Only Java 32-bit installed:

  • netbeans.exe can be pinned
  • netbeans64.exe cannot be pinned

Only Java 64-bit installed:

  • netbeans.exe cannot be pinned
  • netbeans64.exe can be pinned

N.B. when I switched between VM versions, NetBeans complained (though this time only; I don't remember it complaining in the past). This can be solved by changing the netbeans_jdkhome= line in etc/netbeans.conf

2

I just pinned NetBeans 6.8 to the taskbar by launching it from the Start menu and then right clicking the icon in the taskbar. The created shortcut points to "C:\Program Files\NetBeans\bin\netbeans.exe" and it works just fine.

Java 6 Update 17 on Windows 7 32-bit

1

QUICK FIX:

  1. Open Start menu
  2. Locate NetBeans shortcut
  3. Right click, select "Pin to Taskbar"

Works for full 64bit install too!

sibidiba
  • 111
0

The JVM startup parameters can be found under \etc\netbeans.conf

0

Here is the full command used to launch the IDE process on my machine (discovered via the excellent Process Explorer). Obviously your own will be slightly different.

"C:\Program Files\Java\jdk1.6.0_17\jre\bin\javaw.exe" "-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade" "-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense" "-client" "-Xverify:none" "-Xss2m" "-Xms32m" "-XX:PermSize=32m" "-XX:MaxPermSize=200m" "-Dapple.laf.useScreenMenuBar=true" "-Dsun.java2d.noddraw=true" "-Xmx512m" "-Djdk.home=C:\Program Files\Java\jdk1.6.0_17" "-Dnetbeans.home=C:\Program Files\NetBeans 6.8\platform11" "-Dnetbeans.user=C:\Users\alex\.netbeans\6.8" "-XX:+HeapDumpOnOutOfMemoryError" "-XX:HeapDumpPath=C:\Users\alex\.netbeans\6.8\var\log\heapdump.hprof" "-Dnetbeans.system_http_proxy=DIRECT" "-Dsun.awt.keepWorkingSetOnMinimize=true" "-Dnetbeans.dirs=C:\Program Files\NetBeans 6.8\nb6.8;C:\Program Files\NetBeans 6.8\ergonomics2;C:\Program Files\NetBeans 6.8\ide12;C:\Program Files\NetBeans 6.8\java3;C:\Program Files\NetBeans 6.8\xml2;C:\Program Files\NetBeans 6.8\apisupport1;C:\Program Files\NetBeans 6.8\webcommon1;C:\Program Files\NetBeans 6.8\websvccommon1;C:\Program Files\NetBeans 6.8\enterprise6;C:\Program Files\NetBeans 6.8\mobility8;C:\Program Files\NetBeans 6.8\profiler3;C:\Program Files\NetBeans 6.8\ruby2;C:\Program Files\NetBeans 6.8\python1;C:\Program Files\NetBeans 6.8\php1;C:\Program Files\NetBeans 6.8\visualweb2;C:\Program Files\NetBeans 6.8\soa2;C:\Program Files\NetBeans 6.8\identity2;C:\Program Files\NetBeans 6.8\uml6;C:\Program Files\NetBeans 6.8\harness;C:\Program Files\NetBeans 6.8\cnd3;C:\Program Files\NetBeans 6.8\dlight2;C:\Program Files\NetBeans 6.8\groovy2;C:\Program Files\NetBeans 6.8\extra;C:\Program Files\NetBeans 6.8\javafx2;C:\Program Files\NetBeans 6.8\javacard1" "-Djava.class.path=C:\Program Files\NetBeans 6.8\platform11\lib\boot.jar;C:\Program Files\NetBeans 6.8\platform11\lib\org-openide-modules.jar;C:\Program Files\NetBeans 6.8\platform11\lib\org-openide-util.jar;C:\Program Files\NetBeans 6.8\platform11\lib\locale\boot_ja.jar;C:\Program Files\NetBeans 6.8\platform11\lib\locale\boot_pt_BR.jar;C:\Program Files\NetBeans 6.8\platform11\lib\locale\boot_zh_CN.jar;C:\Program Files\NetBeans 6.8\platform11\lib\locale\org-openide-modules_ja.jar;C:\Program Files\NetBeans 6.8\platform11\lib\locale\org-openide-modules_pt_BR.jar;C:\Program Files\NetBeans 6.8\platform11\lib\locale\org-openide-modules_zh_CN.jar;C:\Program Files\NetBeans 6.8\platform11\lib\locale\org-openide-util_ja.jar;C:\Program Files\NetBeans 6.8\platform11\lib\locale\org-openide-util_pt_BR.jar;C:\Program Files\NetBeans 6.8\platform11\lib\locale\org-openide-util_zh_CN.jar;C:\Program Files\Java\jdk1.6.0_17\lib\dt.jar;C:\Program Files\Java\jdk1.6.0_17\lib\tools.jar" org/netbeans/Main "--branding" "nb"

It turned out shortcuts are limited to a certain number of characters as well, and all that wouldn't fit. I tried creating an environment variable to hold it all instead, but it turned out environment variables were of limited length as well (though not as drastically), so I ended up creating two of them.

I ended up with a shortcut target of "C:\Program Files\Java\jdk1.6.0_17\jre\bin\javaw.exe" %NB_PARAMS1% %NB_PARAMS2% starting in "C:\Program Files\NetBeans 6.8\" and that seems to work just fine.

If you want your shortcut to have the right icon, it can be changed to that of the launcher easily.