Home » Questions » Computers [ Ask a new question ]

How to pin NetBeans to Windows 7 taskbar?

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.

Asked by: Guest | Views: 188
Total answers/comments: 4
bert [Entry]

"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)."
bert [Entry]

"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"
bert [Entry]

The JVM startup parameters can be found under \etc\netbeans.conf
The JVM startup parameters can be found under \etc\netbeans.conf
bert [Entry]

"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."