[TIP] Repair WTK after reinstallation of JDK

Java Development Kit(JDK) is evolving and they release new version of the JDK quite often. It's obvious that you want to install the latest JDK with new fixies and uninstall the old JDK. Unfortunatelly, your Wireless Toolkit (WTK) stops work when you uninstall the old JDK. The reason is that the path to the JDK installation directory is hard-coded in the WTK's scripts. This problem occures only with WTK that you installed by yourself. We solved it for the default WTK that is bundled with NetBeans Mobility Pack. The scripts in bundled WTK are changed automatically.

Problem symptoms
You see a message like the one below when you run a project using the broken WTK as the platform emulator in the NetBeans Mobility Pack.
run:
Starting emulator in execution mode
\\nbproject\\build-impl.xml:295: Execution failed with error code 1.
BUILD FAILED (total time: 1 second)
You cannot run the emulator even from command line.

Fixing the Broken WTK Installation
You can easily recover from this situation if you change the JDK path in the WTK scripts for existing JDK installation directory. You will have to change the path at least in these three files in bin directory in the WTK installation directory:
  • emulator.bat
  • prefs.bat
  • utils.bat
Open the files in any text editor and replace the path to uninstalled JDK with the path to the newly installed JDK. Your Wireless Toolkit then starts to work again.

This TIP describes how to fix it on windows platform. The process is almost the same on linux. There is javapathtowtk defined in those three files. Change it to the new installed jdk.


This article has been published even on netbeans.org. You can find more details there - http://www.netbeans.org/kb/articles/fix-toolkit-installation.html.
More tutorials about Mobility Pack - link
Comments:

Post a Comment:
Comments are closed for this entry.
About

This is the main channel to share news, tips and other stuff related to my work. Sometimes you can find even personal stuff. Enjoy your reading...

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
news
Blogroll

No bookmarks in folder

OldNews
MyTrash
NavBar
NetBeans
LinksToBeExpanded