how to build GNU Classpath and JamVM

Help
2009-04-14
2013-05-20
  • Michele Marcon

    Michele Marcon - 2009-04-14

    I'm trying to build GNU Classpath 0.98 and JamVM 1.5.2. Following the JamVM readme, I did 'configure; make; make install' on the jamVM, and it worked.

    I then added jamvm and Sun javac to the path. Then with GNU Classpath I did this:

    ./configure --enable-jni --disable-gtk-peer --disable-gconf-peer --disable-plugin

    I got this error:

    The javac failed (see config.log)

    On the config.log, I see that javac can't find VMStackWalker (which is jamvm-specific) I added the jamvm classes to the CLASSPATH, then I got this error:

    The Java VM jamvm failed (see config.log)

    On the config.log, I see that jamvm cannot find java.lang.Class

    WTF?

     
    • Robert Lougher

      Robert Lougher - 2009-04-14

      The standard javac doesn't work.  I use ecj (the Eclipse Java Compiler).

      Most Linux distributions should provide a standalone package for ecj.

      Rob.

       
    • Robert Lougher

      Robert Lougher - 2009-04-14

      BTW, don't add JamVM to your path until _after_ you've configured and built GNU Classpath.  You don't want GNU Classpath's configure picking JamVM up as a VM, as JamVM won't work without GNU Classpath, which you haven't built yet!

      Rob.

       
    • Michele Marcon

      Michele Marcon - 2009-04-15

      OK, I have already downloaded the ecj from the eclipse website. But it's a .jar file! How am I supposed to run it without a working JVM?

       
      • Michele Marcon

        Michele Marcon - 2009-04-15

        I'm looking for a pre-built classpath-based JDK (no luck yet, I am always get source download). I also tried with eclipse, I dowloaded the libgcj... didn't help. Argh!

        However, please note that the INSTALL text file from JamVM 1.5.2 is incorrect, as it suggest building with jikes (which is not supported with classpath 0.98).

        Thanks for your help!

         
    • Michele Marcon

      Michele Marcon - 2009-04-15

      Another question: do you mean that I need ANOTHER JVM installed for installing JamVM and Classpath?
      This is really strange!

       
    • Michele Marcon

      Michele Marcon - 2009-04-16

      Finally, I managed to get a precompiled classpath-0.98-1.pkg.tar.gz.

      I corrected the broken link from rt.jar to glibj.zip, and I added these files to the classpath, but still it didn't work.

       
      • Robert Lougher

        Robert Lougher - 2009-04-16

        I guess you're trying to run JamVM with the prebuilt GNU Classpath?  There could be lots of reasons why it's not working.

        This is what you should do:

        I assume the following :

        1)  You have jamvm.tar.gz distribution file

        2) You have classpath.tar.gz distribution file

        3) You have some prebuilt classpath.tar.gz

        At this point do not have jamvm in your path.

        1) Unpack the prebuilt classpath.tar.gz file.  Find in it the glibj.zip file.

        2) Unpack the classpath distribution file

        3) Configure classpath, adding the following:

        --disable-examples --disable-tools --with-glibj-zip=<absolute address of the glibj.zip from the prebuilt classpath>

        This will configure Classpath to build the native libraries, etc., but it will not build the Java classes, instead using the prebuilt ones.

        (--disable-examples, --disable-tools, may be wrong, I'm doing this from memory.  Normally, GNU Classpath will also build examples and tools which also require a Java compiler.  The options will be something similar, ./configure --help will show all options)

        4) make && make install

        5) Unpack JamVM

        6) ./configure && make && make install

        * This should work, and you will not need a Java compiler or a working Java VM for the Classpath build *

         
    • Michele Marcon

      Michele Marcon - 2009-04-17

      WOW! It worked!!!!!!

      But still, I've worked out an issue. By using your command, I got this error during compilation:

      checking for stdint types... stdint.h (shortcircuit)
      make use of stdint.h in include/config-int.h (assuming C99 compatible system)
      configure: error: conditional "GCJ_JAVAC" was never defined.
      Usually this means the macro was only invoked conditionally.

      Guessing that GCJ_JAVAC was never defined, but also never actually used. I manually edited the configured and removed the offending "if" clause.

      And only then it worked.

      Many many many thanks!

       
  • Thomas G

    Thomas G - 2009-11-29

    Hello…

    I also try to compile and run the GNU-classpath 0.98 on ubuntu 9.10.
    My target is also to run the jamvm..
    The problem is, that i always get the error after i have write "make":

    cc1: warnings being treated as errors
    cpnet.c: In function ‘cpnet_addMembership’:
    cpnet.c:583: error: dereferencing type-punned pointer will break strict-aliasing rules
    cpnet.c: In function ‘cpnet_dropMembership’:
    cpnet.c:598: error: dereferencing type-punned pointer will break strict-aliasing rules
    make: ***  Fehler 1
    make: Verlasse Verzeichnis '/home/tomek/Desktop/classpath-0.98/native/jni/native-lib'
    make: ***  Fehler 1
    make: Verlasse Verzeichnis '/home/tomek/Desktop/classpath-0.98/native/jni'
    make: ***  Fehler 1
    make: Verlasse Verzeichnis '/home/tomek/Desktop/classpath-0.98/native'
    make: ***  Fehler 1

    I hope somebody can give me some tips. It is really no easy to run the jamvm. Another possibility is, to get the jamvm from the ubuntu repository. But there is the Problem, that i will not work, because the classpath is too old (my suggestion).

    Best regards
    Tomek

     
  • Robert Lougher

    Robert Lougher - 2009-11-29

    cpnet.c is part of GNU Classpath, not JamVM.

    The error you are seeing is a warning.  By default GNU Classpath is configured to treat warnings as errors.  To turn this off, add

    -disable-Werror

    to the GNU Classpath configure line, e.g.:

    ./configure -disable-Werror <rest of arguments>

    Rob.

     
  • Thomas G

    Thomas G - 2009-11-30

    Hello Rob…
    First thank you for your support.
    After i have change the configuration to  ./configure -disable-Werror i get the next error.
    I looks so:

    gcjwebplugin.cc:65:31: error: nsIPluginInstance.h: No such file or directory
    gcjwebplugin.cc:66:35: error: nsIPluginInstancePeer.h: No such file or directory
    gcjwebplugin.cc:67:31: error: nsIPluginTagInfo2.h: No such file or directory
    gcjwebplugin.cc:149: error: ISO C++ forbids declaration of ‘NS_DEFINE_IID’ with no type
    gcjwebplugin.cc:149: error: ‘kIPluginTagInfo2IID’ was not declared in this scope
    gcjwebplugin.cc:149: error: ‘NS_IPLUGINTAGINFO2_IID’ was not declared in this scope
    gcjwebplugin.cc:149: error: initializer expression list treated as compound expression
    gcjwebplugin.cc:207: error: ISO C++ forbids declaration of ‘nsIPluginTagInfo2’ with no type
    gcjwebplugin.cc:207: error: expected ‘;’ before ‘*’ token
    gcjwebplugin.cc: In function ‘gchar* plugin_get_documentbase(NPP_t*)’:
    gcjwebplugin.cc:876: error: ‘nsIPluginInstance’ was not declared in this scope
    gcjwebplugin.cc:876: error: ‘xpcom_instance’ was not declared in this scope
    gcjwebplugin.cc:877: error: ‘nsIPluginInstancePeer’ was not declared in this scope
    gcjwebplugin.cc:877: error: ‘peer’ was not declared in this scope
    gcjwebplugin.cc:878: error: ‘nsresult’ was not declared in this scope
    gcjwebplugin.cc:878: error: expected ‘;’ before ‘result’
    gcjwebplugin.cc:879: error: ‘nsIPluginTagInfo2’ was not declared in this scope
    gcjwebplugin.cc:879: error: ‘pluginTagInfo2’ was not declared in this scope
    gcjwebplugin.cc:884: error: expected primary-expression before ‘)’ token
    gcjwebplugin.cc:898: error: ‘union info_union’ has no member named ‘info_field’
    gcjwebplugin.cc:900: error: ‘result’ was not declared in this scope
    gcjwebplugin.cc:900: error: ‘kIPluginTagInfo2IID’ was not declared in this scope
    gcjwebplugin.cc:920: error: ‘NS_RELEASE’ was not declared in this scope
    gcjwebplugin.cc: At global scope:
    gcjwebplugin.cc:149: warning: ‘NS_DEFINE_IID’ defined but not used
    make: ***  Fehler 1
    make: Verlasse Verzeichnis '/home/tomek/Desktop/classpath-0.98/native/plugin'
    make: ***  Fehler 1
    make: Verlasse Verzeichnis '/home/tomek/Desktop/classpath-0.98/native'
    make: ***  Fehler 1

    After this error massage i decided to run the configuration with ./configure -disable-Werror -disable-plugin.
    The erorr looks so:

    make: ***  Fehler 1
    make: Verlasse Verzeichnis '/home/tomek/Desktop/classpath-0.98/tools'
    make: ***  Fehler 1

    I also tested this with gnu-classpath 0.97.2. Only to test if i get successfull with the make on my ubuntu .The configuration was "./configure -disable-Werror". After make i get the the error which looks like the first error with the gcjwebplugin.cc.

    Sorry for the long text and the boring error massages but I hope you can help and give me a hint.

    Tomek

     
  • Thomas G

    Thomas G - 2009-12-01

    Hello…
    Im back again.
    Jamvm is working now..
    The error massage is always "make: ***  Fehler 1 make:".
    I thought that that error massage is important, but after "sudo make install", the classpath has been installed.
    If somebody has Problems with the java compiler, download the ecj from the ubuntu rep.

    Regards, Tomek

     
  • Junaid

    Junaid - 2012-03-03

    Hello,

    I am facing the problem in executing jamvm. I've compiled classpath-0.98 and jamvm-1.5.2 using the instructions specified above. But when I executed the following command, I am getting the following error.

    jamvm HelloWorld

    Cannot create system class loader
    Exception occured while printing exception (java/lang/NoClassDefFoundError)…
    Original exception was java/lang/ExceptionInInitializerError

    The classpath libraries are present in /usr/local/classpath/share/classpath, and classes.zip is present in /usr/local/jamvm/share/jamvm.

    What can be the problem?

     
  • Anonymous

    Anonymous - 2012-09-13

    gkemot, I had your same exact error. Then I tried classpath-0.96.1 and it compiles perfectly here.

     

Log in to post a comment.