wiki.webvm.net/ webvm/ Daily build notes

Step by step WebVM setup

WebVM depends on a JVM.

Follow the JSX/WebVM subversion checkout guide. You need an account to checkout the source.

svn co svn+ssh://$USER@nox.vm.bytemark.co.uk/srv/svn/code
cd code/trunk

Have a look in the mk/ directory. You probably need to at least define where your HOME directory is and describe your JVM/JNI setup.

CPPFLAGS=-D_DEBUG make
make install # setup plugin symlinks
x-www-browser http://plugin.webvm.net/101/ # 101 is a typical test to make sure the JVM starts

Pay attention to class versions

javac -source 1.3

Often a CDC (mobile Java VM) can only support ealier class files. So you should make sure you’re compiliing with right class file target. Unfortunately a new javac with -target argument doesn’t work, so you need to just install an older javac into /usr/lib/jvm/.

sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/j2sdk1.4.2_16/bin/javac 50
sudo update-alternatives --config javac

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/j2sdk1.4.2_16/bin/java 50
sudo update-alternatives --config java

Use file to double check the .class file, compiled Java class data, version 48.0. There is also a script in “tests/showclass” to help explore class file versions in a jar package.

x61:~% sudo update-alternatives --config java

There are 5 alternatives which provide `java'.

  Selection    Alternative
-----------------------------------------------
*+        1    /usr/lib/jvm/java-gcj/jre/bin/java
          2    /usr/lib/jvm/j2sdk1.4.2_16/bin/java
          3    /usr/bin/gij-4.3
          4    /usr/bin/gij-4.2
          5    /usr/lib/jvm/java-6-sun/jre/bin/java

Press enter to keep the default[*], or type selection number: 5
Using '/usr/lib/jvm/java-6-sun/jre/bin/java' to provide 'java'.
x61:~% java -version
java version "1.6.0_04"
Java(TM) SE Runtime Environment (build 1.6.0_04-b12)
Java HotSpot(TM) Server VM (build 10.0-b19, mixed mode)
x61:~% sudo update-alternatives --config javac

There are 5 alternatives which provide `javac'.

  Selection    Alternative
-----------------------------------------------
          1    /usr/lib/jvm/j2sdk1.4.2_16/bin/javac
          2    /usr/bin/ecj
*+        3    /usr/lib/jvm/java-gcj/bin/javac
          4    /usr/bin/gcj-wrapper-4.3
          5    /usr/lib/jvm/java-6-sun/bin/javac

Press enter to keep the default[*], or type selection number: 5
Using '/usr/lib/jvm/java-6-sun/bin/javac' to provide 'javac'.
x61:~% javac -version
javac 1.6.0_04

Troubleshooting WebVM compilation/installation issues.

You must restart your browser instance when you update the plugin.

defaultPluginPaths

Check plugins installed on your browser

WebKit

/usr/lib/mozilla/plugins

Firefox/Iceweasel

/usr/lib/iceweasel/plugins

about:plugins

Opera

/usr/lib/opera/plugins

Darwin

Or MacOSX. We do the build via Xcode. libjvm is dynamically linked btw. See ~/code/trunk/JSXlib/src/J2SEVM.cpp

If files are added to the src/ you need to also manually add it to the Xcode project!

Build

Checkout Makefile.darwin

Versions

This is a PITA. v.sh currently searches and replace VER: in Info.plist (see npapi).

Setup JSXjni

sudo ln -s ~/jsx/code/trunk/JSXjni/darwin/build/Debug/libJ2SENativeContext.jnilib /usr/lib/libJ2SENativeContext.jnilib

Installing the plugin

  1. cd /Library/Internet\ Plug-Ins/
  2. ln -s $code/trunk/npjsx/darwin/build/Debug/npjsx.plugin