# How to pin NetBeans to Windows 7 taskbar?

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

-

## migrated from stackoverflow.comJan 11 '10 at 1:53

This question came from our site for professional and enthusiast programmers.

I can't pin mine at all (NB6.9, Win7 Pro 64bit, 32-bit JDK) –  Alison Oct 19 '10 at 9:17
@Alison - see the comments under the accepted answer. Apparently it's been registered as a netbeans bug already. Also there is a workaround there. –  Vilx- Oct 19 '10 at 9:45

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).
-
This is logged as bug 178273 in the NetBeans bugzilla. –  mjs Jul 11 '10 at 13:38
is there any update to the bug? I am on NB6.8 and right now using 32 bit java as a workaround. –  Jus12 Mar 17 '11 at 7:59
@Just12 - apparently not, but there is a workaround mentioned there. It will still result in using the 32-bit JVM though. –  Vilx- Mar 17 '11 at 9:50
Thankfully, this bug has been marked to be fixed in version 7.2: netbeans.org/bugzilla/show_bug.cgi?id=178273#c13 –  Dave Lancea Feb 13 '12 at 15:44
Yay! It only took them slightly over 2 years! XD (OK, to be honest, I do understand that they probably had more serious things to do than this) –  Vilx- Feb 13 '12 at 21:38

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

-
Yes, apparently the SevenBeans module suggested by torn works. It's probably obvious, but if you have used the workaround described in the Netbeans Bugzilla before installing SevenBeans, the application needs to be removed from the task bar and pinned again in order to get things working again. Otherwise, the pinning seems to be broken after installing SevenBeans. –  user61763 Jan 6 '11 at 21:05
I can confirm that this works with Windows 7 x64 and the JDK x64. What you do is start Netbeans the first time after installing SevenBeans. Then you pin the icon that is on the taskbar after Netbeans has finished starting up completely. You do get an extra icon during startup on x64 but it goes away after Netbeans is running. –  Brian Reiter Feb 3 '11 at 23:24
Does it have the performance issue as pointed out by Vilx- ? –  Jus12 Mar 17 '11 at 7:59

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

-
Funny, because I have the exact same setup, except that my Windows is 64 bit. The other machine I've mentioned however also is 64 bit. –  Vilx- Jan 7 '10 at 1:25
This lets me create a pinned NetBeans icon, but if I click on it it creates a "new" NetBeans icon in the taskbar. (Everything is 64-bit.) –  mjs Jul 11 '10 at 13:28

QUICK FIX:

2. Locate NetBeans shortcut
3. Right click, select "Pin to Taskbar"

Works for full 64bit install too!

-
Yes and no; this pins the launcher, but not the actual NetBeans app. So you have two icons when NetBeans is running. –  Jon of All Trades Sep 21 '13 at 23:44

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

-

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.

-

Problem found and solved.

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

Only Java 7 32-bit installed:

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

Only Java 7 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

-