culvertsoft / mgen

Tools for cross-language data models
MIT License
43 stars 3 forks source link

compiler error #1

Closed tianyj closed 9 years ago

tianyj commented 9 years ago

Hi: when I use Mgen,I have something error:

qq 20141231171007

the Mgen dir : E:\mgen-0.1, and I have set the environmental variables(MGEN_INSTALL_PATH) ,and add it to path

project.xml and module file are

  <Sources>
    <Source>model.xml</Source>
  </Sources>
  <Generator name="Java">
    <output_path>src/main/java</output_path>
    <classregistry_path>com.catpaw</classregistry_path>
      <class_path>se.culvertsoft.mgen.javapack.generator.JavaGenerator</class_path>
  </Generator>
</Project>

<Module>
  <Types>
    <Apple>
      <weight type="float32"/>
      <name type="string" />
    </Apple>
  </Types>
</Module>

how can to resolve the error?

thanks!

GiGurra commented 9 years ago

You seem to have done everything correct. Can you confirm that:

to check on windows:

or linux:

Can you also tell me what command you use to call the compiler?

For example, if environment variables don't work (for whatever reason), you can try passing plugin paths to the compiler as an argument:

tianyj commented 9 years ago

I checked MGEN_INSTALL_PATH , it's correct, but it don't work. my command : mgen project.xml. Now I use: mgen myproject.xml -plugin_paths="E:/mgen-0.1/jars" It compiled successfully , Maybe the MGEN_INSTALL_PATH does not work. Thanks,and Happy New Year!

GiGurra commented 9 years ago

I just tested downloading 0.1 on my computer and MGEN_INSTALL_PATH works for me :/ (using english win7 64bit java7 64bit). Also checked the code and not seeing anything wrong right now..

Sry I cannot explain why the environment variable is not working for you :(. In addition to setting MGEN_INSTALL_PATH to E:/mgen-0.1, can you try setting MGEN_PLUGIN_PATH to E:/mgen-0.1/jars ?


What if you try writing a java application like:

public static void main(String[] args) {
    System.out.println(System.getenv("MGEN_INSTALL_PATH"));
}
tianyj commented 9 years ago

the console print: null( System.out.println(System.getenv("MGEN_INSTALL_PATH")); ),Maybe the environment variable does not work. I check my environment variables,it is setted correctly:

20141231171305

GiGurra commented 9 years ago

Interesting! Maybe it has to do with some localization/language issue.

Or some permission/user issue for your jvm? Can you try this:

    System.out.println("Envirionment Variables:");
    for (java.util.Map.Entry<String, String> e : System.getenv().entrySet()) {
        System.out.println("   " + e.getKey() + " = " + e.getValue());
    }

What variables can your jvm see?

Are you running mgen on the same user name you set the environment variable?

tianyj commented 9 years ago

I find reason that the environment variable of MGEN_INSTALL_PATH does not work. It need to restart computer. After restart,the MGEN_INSTALL_PATH works! I didn't shutdown computer for over a mouth, maybe it needs rest.:smile: Thanks!