This may be a silly question, but i'm learning about gem5 recently and i'm being able to simulate my C programs using this software, in syscall emulation and in full system simulation. However, whenever I try to simulate any Java program into it, I get this error(syscall emulation):
gem5 Simulator System. http://gem5.org
gem5 is copyrighted software; use the --copyright option for details.
gem5 compiled Aug 26 2019 12:58:15
gem5 started Sep 5 2019 14:56:02
gem5 executing on (...), pid 6115
command line: build/X86/gem5.opt configs/learning_gem5/part1/test.py
Global frequency set at 1000000000000 ticks per second
warn: DRAM device capacity (8192 Mbytes) does not match the address range assigned (512 Mbytes)
fatal: fatal condition !obj_file occurred: Cannot load object file /home/taoliveira/Downloads/Gem5/gem5/configs/learning_gem5/part1/../../../my-progs/MergeSort/bin/x86/linux/MergeSort.
Memory Usage: 661468 KBytes
In this case, I tried a simple mergesort Java program. It is compiling and executing normally outside the gem5 simulator. In the .py file where I have my machine(it's the simple.py of gem5 tutorials), the binary is a path which leads to the .jar file. I've heard that .jar would not work properly in gem5 but I don't know what to use instead. So, what I have to do to run non-C programs in gem5 simulator? In this case, what I have to do to run a java program?
I looked everywhere for an answer but wasn't able to find it. Can anyone help me, please? Thanks in advance.
I'm using Ubuntu 18.04 and Java 1.8.0_201.
Edit : I've tried to convert my Java code to native machine code(x86) and did it with GraalVM, and i'm passing it to the runscript, in the same way I did with C programs. However, it shows me a new error when loading the script:
loading script...
Fatal error: Failed to create a new Isolate. (code 6)
Never seen it before and didn't find anything about it when googling.