Sunday, 25 January 2009

Open University M256 OS X Configuration


It's the same problem, I've started a new course with the OU and Windows is required. Well here's some instructions for making M256 OS X ready. 

What you'll need:

  1. Netbeans 4.1 for OS X
  2. Violet UML editor. You can get this from the OU M256 site or from Cay Horstmann's site.
  3. The M256 installation CD

Instructions:

  • Copy the M256Code directory from the M256 installation CD to your working directory. You can copy it to any location, but for the sake of tidiness, and to know where project files are, it's best to copy it to your working directory. Mine for example is /Users/geoff/OU/M256/
  • Install Netbeans 4.1 if not already installed.
  • Open Netbeans, click on 'Tools' then 'Library Manager'
  • Click on 'New Library' in your Library Manager and add 'm256date' (without the quotes) as a new class library. Click 'Ok'
  • Repeat the above step, but create a new class library called 'm256gui' (again without quotes). Click 'Ok' once done. Your Library Manager should now look similar to this:



  • Highlight the m256date library in the Libraries pane. Ensure Classpath is select above the Library Classpath pane. Click on 'Add JAR/Folder'. From the file chooser, select m256date.jar. This will be from directory that you copied from the M256 installation CD, mine is /Users/geoff/OU/M256/M256Code/m256libraries/m256date.jar.
  • Next you'll need to add the m256date source files. Select the 'Sources' option. Click on 'Add JAR/ Folder'. From the file chooser, select the m256date source files, so ../M256/M256Code/m256libraries/src/m256date.zip
  • Click on Javadoc and again using the file chooser, select the zip files containing the Java docs. These would be in the following director /M256/M256Code/m256libraries/doc/m256date.zip
  • Repeat all the above, but for the m256gui class library. Add the respective Jar and zip files to the classpath, sources and Javadocs as above.
If done correctly, you'll now be able to open the OU Projects in Netbeans, compile and run them without any issues. I don't believe you'll need to do any additional configuring for the UML editor (Violet), but it's a requirement for the course, so make sure you've got it to hand. 

Wednesday, 19 November 2008

User profile creation - CentOS



From root (replace where necessary):

  • /usr/sbin/useradd newuser
  • /usr/bin/chage -d 0 newuser
  • /usr/sbin/usermod -p "" newuser

then change the password.

Tuesday, 6 November 2007

OS X, J2ME and NetBeans 6.0


The gripe of many Java Developers wanting to do Java Mobile development on OSX - where is the support?! It can be a bit of an effort to get J2ME up and running on a Mac, so here’s how to do it using NetBeans 6.0 and OS X Leopard. Thanks to Lukas Hasik for the stuff he's compiled on the net relating to this issue!

What you'll need:

Steps to take:

  1. Copy the extracted folder "mpp-sdk" (the SDK from MPowerPlayer) to a chosen location. I copied mine to /Application/mpp-sdk
  2. extract the mobility pack zip file so you’ll be left with a mobility8 folder
  3. copy the mobility8 folder into the package contents of the NetBeans.app (Ctrl + click the NetBeans.app icon and select “show package contents”) and copy the folder mobility8 into Contents/Resources/Netbeans/
  4. check the netbeans.cluster file found in the etc folder. Open it with some editor. If you can see “mobility8”, close the file and move on to the next step. If “mobility8” is not there, update the file with mobility8 at the end of the list.
  5. next you configure NetBeans. Open the application and select the Java Platform Manager by clicking on ‘Tools’ and selecting ‘Java Platforms’. Click ‘Add Platform…’ and select ‘Custom Java ME MIDP Platform Emulator’.
  6. In the next screen (General Information) update the fields as follows (Note the properties at the bottom of the window as well):

    Platform Home: This is where the MPowerPlayer SDK is installed as per step 2. So for me it is /Applications/mpp-sdk

    Platform Name: This can be whatever you want assuming it doesn’t clash with an already existing platform. I called mine MpowerPlayer

    Device Name: Again whatever name you like. I called mine MPowerPlayer Device

    Preverify Command:
    “{platformhome}{/}osx{/}preverify{/}preverify” {classpath|-classpath “{classpath}”} -d “{destdir}” “{srcdir}”

    Execution Command:
    java -jar {platformhome}{/}player.jar {jadurl}

    Debugger Command:
    java -Xdebug -Xrunjdwp:transport={debugtransport},server={debugserver}, suspend={debugsuspend},address={debugaddress} -jar {platformhome}{/}player.jar {jadurl}


  7. Press the Next button. You’ll see listed all the jar files from the mpp-sdk folder. You’ll need to remove the following files from the NetBeans Platform Manager in order for your mobile apps to compile and run. Note that the location of the jar files may differ if you never copied the mpp-sdk folder into the Applications directory as per step 2. Select them and click 'Remove':
    /Applications/mpp-sdk/cldc.jar
    /Applications/mpp-sdk/midp.jar
    /Applications/mpp-sdk/player.jar
    /Applications/mpp-sdk/protector/protector.jar


  8. Click Finish and you’re done!