JS error

Sal Ferro
  • Sal Ferro
    Sal Ferro

    Hi -

    First off, j2s is a really cool product. Beats the pants off GWT imo.

    I'm getting a JS error currently.  It is:

    Error: objThis.getClass is not a function
    Source File: file:///C:/downloads/eclipse-SDK-3.1.2-win32/eclipse/plugins/net.sf.j2s.lib_1.0.0/j2slib/j2s-core-bare.z.js
    Line: 959

    the line reads:

    }else if(objThis.getClass().superClazz==null){

    I'm new to the app, so a few questions:  To troubleshoot and possibly fix this problem how shoul dI go about it?  is all the j2s JS generated from java? And how to build the js packages that j2s ships with?

    Thanks in advance for all your help.

    • Josson Smith
      Josson Smith

      First about the JS error, would you please post more details about what you're running? Your original *.java or other things?

      Second about J2S, almost all of *.js are generated by Java sources (Some of java sources contain native JavaScript codes). For more details about building and packing J2S, please set up j2s environment from subversion by:
      And see more details on project net.sf.j2s.lib/build/build.xml

      Third about troubleshooting, if problems is on Java source, debug them with Eclipse JDT (this debugging has nothing with Java2Script); if it's not the bug of Java sources, it may be a bug of Java2Script's core bug, or it may be a defect of Java2Script's core. For such scenario, you may have to debug into JavaScript sources, which requires advanced knowledge of Java2Script. Currently there are no JDT-like debug tools for JavaScript, but Firefox with Firebug or JavaScript Debugger do help a lot.