Code Monkey home page Code Monkey logo

tinyj2c's People

Contributors

digitalgust avatar liux-pro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinyj2c's Issues

class not found :java/lang/Object

can it handle abstract classes? i was trying to convert one. the .c is empty when I look at it.

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "com.ebsee.classparser.ClassFile.getMethods()" because "cf" is null
at com.ebsee.j2c.ClassManger.findMethod(ClassManger.java:299)

Compile issues

Thank you for your previous reply in /mini_jvm
I have some problems when compile minijvm_rt.jar to C code

  • I use intelliJ Idea to compile class2c.jar and run it to make /out/c .c file, it's ok
    but file generated "metadata.h" have struct struct java_lang_Class {InstProp prop; VMTable* vm_table; struct java_lang_ClassLoader* classLoader_3; struct java_lang_String* name_4; JArray * enumConstants_5; struct java_util_Map* enumConstantDirectory_6; s64 classHandle_7; struct org_mini_reflect_ReflectClass* refClass_8;};
    it's not compatible with default jvc.c, native_std.c : JObject *ins_of_Class_create_get(JThreadRuntime *runtime, JClass *clazz) { JClass *java_lang_class = g_procache.java_lang_class_raw->clazz; if (java_lang_class) { if (clazz->ins_of_Class) { return clazz->ins_of_Class; } else { struct java_lang_Class *ins = (struct java_lang_Class *) new_instance_with_class(runtime, java_lang_class); gc_refer_hold(ins); Java_java_lang_Class__init____V(runtime, ins); clazz->ins_of_Class = (__refer) ins; ins->classHandle_6 = (s64) (intptr_t) clazz;//todo , find it use field refer return (JObject *) ins; } } return NULL; }
    So I changed classHandle_6 to classHandle_7, before that vm/
    .c file could be compiled to .obj file
  1. after that I use CMake to genarate Makefile, but it stuck when compile jvm.c file
    so I remove {GUI_FILES} in CMake, it ran OK, compiled all /out/c/*c file to obj
    But there are errors at last combination:
    CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x4938e): undefined reference to new_instance_with_classraw_index'
    CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x49408): undefined reference to construct_string_with_utfraw_index' CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x49445): undefined reference to new_instance_with_classraw_index'
    CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x49488): undefined reference to throw_exception' CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x49571): undefined reference to new_instance_with_classraw_index'
    CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x495b4): undefined reference to throw_exception' CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x495ee): undefined reference to new_instance_with_classraw_index'
    CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x49631): undefined reference to throw_exception' CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x496ca): undefined reference to new_instance_with_classraw_index'
    CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x49744): undefined reference to construct_string_with_utfraw_index' CMakeFiles\ccjvm.dir/objects.a(com.sun.cldc.util.mini.TimeZoneImpl.c.obj):com.sun.cldc.util.mini.TimeZoneImpl.c:(.text+0x49781): undefined reference to new_instance_with_classraw_indexCMakeFiles\ccjvm.dir\build.make:11704: recipe for target 'ccjvm.exe' failed
    mingw32-make[2]: *** [ccjvm.exe] Interrupt
    CMakeFiles\Makefile2:93: recipe for target 'CMakeFiles/ccjvm.dir/all' failed
    mingw32-make[1]: *** [CMakeFiles/ccjvm.dir/all] Error 130
    Makefile:101: recipe for target 'all' failed
    mingw32-make: *** [all] Error 130`
    Could you help me handle there problems. Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.