If you use Microchip microcontrollers you really have to try out the new MPLAB.X ide Microchip is working on. It is already up to beta5 where all major problems and all major functionalities are fixed.
Major improvements MPLAB.X offers differently from MPLAB v8.x are
- It is multiplatform so it works on Windows, Linux and OSX
- It uses modern GUI that works and does not crash (like old ugly mplab 8 does) based on NetBeans (initially made by Sun, now owned by Oracle)
- Bunch of stuff that comes with NetBeans (code coloring, code expansion, syntax checking, different plugins, multiple projects in project group, versioning …)
Major news in MPLAB.X beta5 compared to MPLAB.X beta4
- The parsing of the “core” terms works properly now
- PicKit2 is now supported
- C18 works now on OSX too
Major problems with MPLAB.X (current beta5 version)
- It does not work “properly” on 64bit Linux
This is why I’m writing this post. What does “properly” means here. If you have 64bit linux with 64bit java (jdk or jre) MPLAB.X will use this 64bit java and everything will work except MPLAB.X will not be able to see your PicKit2 or PicKit3 (I assume the same problem will be with other programmers but I use PicKit2 and PicKit3). The work around is to compile your own pk2cmd and use it outside of the MPLAB.X ide but it is really ugly solution, not to mention, there is still no open source version of pk3cmd so if you have PicKit3 there is no work around. The only way around this problem is to install 32bit java.
As I do use java a lot and I use it for memory hungry applications too I really need 64bit java to be default on my system (as 32bit java cannot use more then 2G of RAM) so I did following.
- Download 32bit java from Oracle
- Be sure to get .bin and not .rpm.bin even if you are using rpm based distro!
- Execute downloaded bin file in some directory and it will unpack itself
- Rename the extracted directory by adding a -32bit suffix to it (for e.g. mv jdk1.6.0_24 jdk1.6.0_24-32bit ) and move the new directory to a place of your choosing (for e.g. mv jdk1.6.0_24-32bit /usr/java/ )
Now create a script that will start the mplab_ide with 32bit java:
#!/bin/sh
JAVA_HOME=/usr/java/jdk1.6.0_24-32bit
PATH=/usr/java/jdk1.6.0_24-32bit/bin:$PATH
/usr/bin/mplab_ide
Start the script and voila, now your MPLAB.X detects your PicKit2 and your PicKit3 properly :)






41 Comments to 'How to make MPLAB.X work properly on 64bit Linux'
March 12, 2011
I will try this. I have been trying to get 64bit Ubuntu to work for a some time now.
Thank You!
March 12, 2011
I tested this only on Fedora14 64bit but I don’t see why it would not work on Ubuntu. The major “solution” here is actually to install 32bit JRE/JDK and make mplabx use that instance. Then everything works like a charm. With 64bit JRE MPLABX works but it has bunch of issues (code not parsed properly, pickit not recognised etc etc)
March 18, 2011
Works on Ubuntu 10.04 lucid. Thanks a ton!
March 19, 2011
You are most welcome :)
April 5, 2011
Thank you very much!
I have successfully tested PIC32 Starter Kit and PIC24F Starter Kit.
It works great on openSUSE 11.3.
April 11, 2011
I am running Fedora 14 x86_64. When I launch MPLABX from the Applications menu it runs fine(using 64 bit java) but does not recognize my pic32 usb starter kit 2. When I use a script to launch MPLABX with 32 bit java it just doesn’t start (there is a delay for some time then nothing happens). What can the problem be?
April 11, 2011
In order to java 32bit java working properly you need to have other 32bit libraries installed on you linux.
make sure you have these (I’m not sure if all these are required but some of them are, versions are not important):
libstdc++-4.5.1-4.fc14.i686
libgcc-4.5.1-4.fc14.i686
compat-libstdc++-33-3.2.3-68.i686
libsigc++20-2.2.4.2-1.fc12.i686
glib2-2.26.0-2.fc14.i686
libhid-0.2.17-6.fc14.i686
libusb-0.1.12-23.fc14.i686
libusb1-1.0.8-1.fc14.i686
glibc-2.13-1.i686
qt-x11-4.7.1-17.fc14.i686
qt-4.7.1-17.fc14.i686
qt3-3.3.8b-30.fc14.i686
gtk2-2.22.0-1.fc14.1.i686
gtk3-2.90.5-1.fc14.i686
These one should also help:
readline-6.1-2.fc14.i386
glibmm24-2.24.2-1.fc14.1.i686
libcanberra-gtk2-0.25-4.fc14.i686
libcanberra-0.25-4.fc14.i686
gd-2.0.35-11.fc13.i686
libcom_err-1.41.12-6.fc14.i686
libudev-161-8.fc14.i686
cairo-1.10.2-2.fc14.i686
libxml++-2.33.2-1.fc14.i686
libtool-ltdl-2.2.10-3.fc14.i686
libuuid-2.18-4.8.fc14.i686
zlib-1.2.5-2.fc14.i686
dbus-libs-1.4.0-2.fc14.i686
libcanberra-gtk3-0.25-4.fc14.i686
April 12, 2011
Anyone got any idea if there is a similar solution for windows? Would be awesome!
Thanks
April 12, 2011
I understood mplabx properly work on 64 bit windows, you just need to download 64bit version of mplabx ?
April 13, 2011
I have the 64-bit version of MPLABX B5. But when I try to build and upload my project to the chip an error message says
“The programmer could not be started: Please select a connected tool in Project Properties to continue. PICkit2PlatformTool”
April 13, 2011
Hi Frederik, you see the picture in the post showing how the tool selector in project properties look. When you open this page in your MPLAB X b5, do you see below PicKit2 (I assume you use pickit2) a line that starts with SN: and then some serial number (or if you named your pickit2 then a name). If you do not see that line it means that your pickit2 is not recognized. If you look at the picture in the post you will find that both pickit2 and pickit3 devices are recognized by the mplabx. You need to select the “device” (see how pickit2 device is selected on attached picture) and not the “group”.
April 13, 2011
I see the line Pickit2 with the two yellow dots but not the line under it saying something about SN
:(
April 13, 2011
That means that pickit device is not recognised.
Is it connected?
Are you using 64bit JRE with 64bit MPLABX on 64bit windows? I’m not really a windows expert nor windows lover so I never tried mplabx on windows (nor I plan to ever do that). Maybe you should try with 32bit jre and 32bit mplabx.
April 13, 2011
Yes I am using 64bit JRE with 64bit MPLABX on 64bit windows. I might try installing 32bit java and mplabx tomorrow and see how it works out.
Thanks for your guide :)
Fredrik
April 14, 2011
That would be a next step .. try 32bit java and 32bit mplabx .. also check google, there is a lot of users on widows so maybe someone solved the problem already
April 14, 2011
Today I installed 32bit jdk and had to do nothing more. Now I can program my device and debug without problems.
Thank you very much for your post!
April 14, 2011
well, sorry my bad English but I talk Spanish. Well, I’m trying everything on Ubuntu 10.10 and don’t work yet. I did all above but still does not work. Thanks anyway.
My best regards.
April 15, 2011
Andres, no worries, mine English ain’t that good aether :D and your English is definitely better then mine Spanish :D
I am Fedora user (tested with Fedora 10 and Fedora 14) so have not tested with Ubuntu but if you look at previous comments Craig made it work with Ubuntu 10.04 without problems.
Are you sure you have 32 bit java installed? Then check what version of java mplabx is running – be sure it is the 32bit one. You can check “ps ax | grep -i mplabx” and look at what is the path to the java binary mplabx is using and then check if that binary is 32bit.
April 15, 2011
I did it!! :D. Thanks for your attention Bogdan, but I didn’t need the command you said to achieve the pickit2 connect with mplabx, although after everything was working fine, I ran it and this command say us very important information and the Java version that is running. Command very useful :D.
Well, I was reading other issues about Java and I found this command very useful, but a think only works on Ubuntu. So, the command is “sudo update-alternatives –config java”. Then the user wrote the sudo password, should out something like this:
Sel Path Priority Status
————————————————————
0 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 automatic
* 1 /usr/lib/jvm/ia32-java-6-sun/jre/bin/java 63 manual
2 /usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual
Press Enter for to hold actual option[*], or write the selection number:
————————————————————-
those are the versions of Java installed on my Ubuntu 10.10. and I choose number 1 than is the 32 bit version I got.
Then I execute the command “mplab_ide” in the terminal and now works. I don’t need the bash-script above.
It’s important to say that early I installed ia32-libs for compatibility with java-32bit. The command is:
“sudo apt-get install ia32-libs”
The installation of Java is very easy from /system/Administration/Synaptic Manager in the user graphical panel. We can install the Open JDK that is my version installed now.
In this case we don’t need download the Oracle’s Java.
So , I hope this can help to many others with the trouble. My best regards to everybody.
April 15, 2011
Hi Andres,
What you did there is you set your 32bit JVM to be “primary” JVM on the machine. The bash script I use allow me to have 64bit JVM on my machine as default (for all other programs so they can use this 24G of ram I have in my desktop) and only mplabx to use 32bit version of JVM. Anyhow, if you do not use Java yourself for your own projects that require more then 2G of ram, this is a perfect solution :)
I just hope soon the Microchip will ship a 64bit version of mplabx for us to enjoy all benefits of 64bit system :)
April 15, 2011
Hi Bogdan,
You’re right. Just that your solution don’t work on Ubuntu 10.10, at least on mine, so although your solution is much better than mine, I’m happy now I can plug the pickit2 and for the moment I have not found a better solution. Anyway thank you again because people like you makes better the world.
April 15, 2011
No worries. It is important that it works.
May 2, 2011
Just a little tip. The file mplab_ide is actually a shell script, so if you want to keep things tidy, you could add the extra lines to it. This means that all shortcuts and menu entries still work, but you will need to change the mplab_ide file if it is replaced during an upgrade of mplabx.
May 20, 2011
On Ubuntu 10.10 (Maverick): Once I’d installed the 32 bit JRE as above, I also had to install the 32 bit libraries like this:
sudo apt-get install ia32-libs
BTW, I found that if I made a typo in the script, then mplab-x would run, but still using the 64 bit JRE, so if you are still having problems, do a ps -aef and look for the jre you are using – it should be the 32 bit one you installed. If not, check yr script :-)
June 19, 2011
JRE32 and ia32-libs are installed (LMDE) but still “PICkit3 not found”.
oppa 10445 10444 4 17:51 pts/0 00:00:00 /bin/bash /opt/microchip/mplabx/mplab_ide/bin/../p
oppa 10550 10445 99 17:51 pts/0 00:00:02 /usr/lib/jvm/java-6-openjdk/bin/java -Djdk.home=/u
That script seems not to work, does it need to run as root ?
MPLABX is terrible slow though…
June 20, 2011
This:
/usr/lib/jvm/java-6-openjdk/bin/java
Does not seams to be 32bit binary? Are you sure you are making mplabx use 32bit binary. By default if you install both 32bit and 64bit binaries it will use 64bit one. You need to force it to use the 32bit binary.
I’m not big fun of MINT so I can’t be sure what is wrong (I use Fedora and everything works perfectly), but for starters check if you are using the proper java. If needed uninstall the 64bit java completely and reinstall later (should be a simple task on mint).
Wrt MPLABX being slow, it works superbly fast on my box (Fedora 14, 64bit, 12G ram, i7 cpu running at 3GHz iirc) … if it’s slow on your box check the resource usage – top will show you how much ram is mplabx using, the major reason for slowness is usually swapping so check where you are on the ram..
On the other side of things, all compilers are cli binaries now so you can use your favorite editor and just use Makefile+make to compile the project.
June 20, 2011
Thnx :))
July 15, 2011
Thanks! I’m on ubuntu 10.04 LTS; downloaded the 32-bit Java Virtual Machine from Sun/Oracle’s site; wrote a similar script to yours and all systems are go!
I now have a blinking light on my PICkit3 demo board (with PIC18F45K20)!
July 30, 2011
Thanks a lot, now my ethernet starter kit works fine!
July 30, 2011
To get MPLAB X beta 7.01 working with the prescribed script here on an Ubuntu 10.10 64-bit machine, I had to make one small change in the /usr/bin/mplab_ide command script itself:
before Line 51:
if [ -n "$jdkhome" -a \! -d "$jdkhome" -a -d "$progdir/../$jdkhome" ]; then
# #74333: permit jdkhome to be defined as relative to app dir
jdkhome=”$progdir/../$jdkhome”
fi
add this (done with sudo permission of course):
jdkhome=”/folder/jre1.6.0_26-32bit”
where you specify the location of the 32bit jre after running the jre-6u26-linux-i586.bin file, for example. Could even talk to the PICkit 3 using the 32-bit 1.7.0 jre.
August 9, 2011
I also use ubuntu 64bit and MPLAB X beta 7.01.
I add the line:
jdkhome=”/opt/java32/jre1.6.0_26-32bit”.
(this is the place where i extracted the bin-file.)
But now my mplabx doesn’t start. The following Error is shown in the console:
Cannot find java. Please use the –jdkhome switch.
maybe somebody can help me to solve this problem
August 25, 2011
In beta 7.02 you only have to make a modification to
/opt/microchip/mplabx/mplab_ide/etc/mplab_ide.conf
One line change (remember to remove # before “jdkhome=”)
# default location of [32 bit] JDK/JRE, can be overridden by using –jdkhome switch
jdkhome=”/usr/lib/jvm/jre-1.6.0-sun”
My java install looks like this
# update-alternatives –config java
There are 3 alternatives which provide `java’.
Selection Alternative
———————————————–
*+ 1 /usr/lib64/jvm/jre-1.6.0-openjdk/bin/java
2 /usr/lib64/jvm/jre-1.5.0-gcj/bin/java
3 /usr/lib/jvm/jre-1.6.0-sun/bin/java
August 25, 2011
Works on Fedora 15! Thank you! I followed the instructions exactly.
August 25, 2011
@Roger, great, looks like ppl from Microchip decided to make our lives easier :D and added javahome option. If only they make a way for easier upgrade of the mplabx (not that it is too complex attm but some automated update would be cool :D )
@Duncan, glad it works on F15. I’m still on F14 as I never (any more) upgrade to Fedora that is less then 6 months old, cause I use Linux as only os so all the “ah we forgot to fix the nvidia drivers” and similar issues don’t really work for me :). I think I’ll be looking at F15 in autumn.
August 29, 2011
Hey mate, you saved my life here! Just a thanks would be too little to say :)
September 5, 2011
works well for me….
thanks…
March 8, 2012
Hi,
I have install mplab.X on Ubuntu 11.4. How do I start up the mplab_ide ? I am unable to locate this executable file.
Thanks,
Fred
March 13, 2012
by default it is here:
/opt/microchip/mplabx/mplab_ide/bin/
April 26, 2012
Hmm, I’m running 64bit linux mint 9 and I don’t think I installed the 32 bit java yet I DO se the pickit2 in the tools. BUT it doesn’t seem to present me with a programmer option and the download tool in the menu didn’t seem to work.
April 26, 2012
The latest version of the MPLAB.X should work with 64bit java too, just be sure to
– use REAL java (from SUN, not that openJDK crap)
– use java 1.6 and NOT 1.7!
March 8, 2013
[...] Maybe it is possible to run MPLab X on Linux 64 after all. See here which links to here. [...]
Leave a comment