Closed ghost closed 4 years ago
Sorry for just getting to this.
I think the issue is with your command compiling the *.java file.
You should be compiling the java file with the classpath option pointing to the JDK files that get compiled as part of the JLang make.
./bin/jlangc -cp jdk/out/classes BT.java
This will compile it with the right reference names so that, once you link against our JDK library it finds these references (I tried it with your code example and linking succeeds).
However, I did run into problems actually running your code; I think mashing everything into one file might be finding some sort of edge case in our compiler (since it does run fine under normal java). I'm looking into what exactly is causing that problem.
Yeah i just figured out the issue.
Jlang actually can't properly compile and reference multiple classes within a single source file. You can create nested classes that are properly accessible but since you have multiple top-level classes in a single source file, at runtime the classes don't properly refer to each other.
This causes a runtime error when trying to initialize the Timer
field of BTBase
, for instance.
I would recommend changing this back to a multi-file project.
Hello,
Thank you very much for your response, I will give it a shot.
I have a multi-file Java application, and I consolidated all Java files to a single file (called BT.java).
I could run it using JDK without any problem: $
javac BT.java
$java BT -np8 CLASS=A
But couldn't run it with JLang: $
./bin/jlangc BT.java
$./bin/compile_ll.sh BT.ll
I guess JLang couldn't link some applications properly.