java.lang.VerifyError: Bad type on operand stack

Sven Reimers sven.reimers at
Tue Jan 6 15:13:46 UTC 2015


as suggested by Brian I tried to get some sample code written and running
on top of valhalla.

First problem I encountered was that a missing diamond <> on the right hand
side (my bad - seems I am really relying on my IDE) was just a warning that
I was using a raw type.

Running my example I got this:

Specializing Valhalla$Point3D${0=I}; searching for Valhalla$Point3D.class
(not found)
Specializing Valhalla$Point3D${0=I}; searching for Valhalla$Point3D.class
Error: A JNI error has occurred, please check your installation and try
Exception in thread "main" java.lang.VerifyError: Bad type on operand stack
Exception Details:
    Valhalla.main([Ljava/lang/String;)V @36: invokevirtual
    Type 'Valhalla$Point3D' (current frame, stack[2]) is not assignable to
  Current Frame:
    bci: @36
    flags: { }
    locals: { '[Ljava/lang/String;', 'Valhalla$Point3D' }
    stack: { 'java/io/PrintStream', 'java/lang/StringBuilder',
'Valhalla$Point3D' }
    0000000: bb00 0259 04b8 0003 05b8 0003 06b8 0003
    0000010: b700 044c b200 05bb 0006 59b7 0007 1208
    0000020: b600 092b b600 0ab6 000b b600 0cb6 000d
    0000030: b1

at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(
at java.lang.Class.privateGetMethodRecursive(
at java.lang.Class.getMethod0(
at java.lang.Class.getMethod(
at sun.launcher.LauncherHelper.validateMainClass(
at sun.launcher.LauncherHelper.checkAndLoadMain(

Example Code (see the missing <> just after Point3D...):

public class Valhalla {

   public static void main (String[] args) {

      Point3D<int> intPoint = new Point3D(1,2,3);

      System.out.println("X: " + intPoint.getX());


   public static class Point3D<any T> {
 private T x;
private T y;
        private T z;

        public Point3D(T x, T y, T z) {
this.x = x;
                this.y = y;
                this.z = z;

        public T getX() {
   return x;

        public T getY() {
   return y;

        public T getZ() {
   return z;



Hope to provide more feedback once I got more code running.

Thanks for the impressive work so far.


Sven Reimers

* Senior Expert Software Architect
* NetBeans Dream Team Member:
* Community Leader  NetBeans:
                              Desktop Java:
* JUG Leader JUG Bodensee:
* Duke's Choice Award Winner 2009
* Blog:

* LinkedIn:

Join the NetBeans Groups:
* LinkedIn:
* Oracle:

More information about the valhalla-dev mailing list