Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java version issue when trying the example #24

Open
MadeInPierre opened this issue May 8, 2022 · 2 comments
Open

Java version issue when trying the example #24

MadeInPierre opened this issue May 8, 2022 · 2 comments

Comments

@MadeInPierre
Copy link

Hi!

Apologies for the beginner question. I am trying to run the example use case under the Script directory. The ./install-dependencies.sh script finished without issues until the example. At first, I unfortunately had this error when running the example script with Java 8 or 11:

$ ./generateSchedule.sh example.java
rm: cannot remove 'output/*': No such file or directory
:./libs/com.microsoft.z3.jar:./libs/gson-2.8.6.jar:./libs/java-json.jar:./libs/TSNsched.jar
UseCase.java:1: error: cannot access JSONParser
import com.tsnsched.core.interface_manager.JSONParser;
                                          ^
  bad class file: ./libs/TSNsched.jar(/com/tsnsched/core/interface_manager/JSONParser.class)
    class file has wrong version 61.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
[...]

It seemed like the .jar lib files were complied using Java 17 (version 61.0 shown above) while version 11 was expected (version 55.0). The same happens when trying with Java 8, except 55.0 is replaced by 52.0.

I then tried to install Java 17 and run the script with it, but I get a different error:

$ ./generateSchedule.sh example.java                                        
rm: cannot remove 'output/*': No such file or directory
:./libs/com.microsoft.z3.jar:./libs/gson-2.8.6.jar:./libs/java-json.jar:./libs/TSNsched.jar
Exception in thread "main" java.lang.NoSuchMethodError: 'void com.microsoft.z3.Solver.add(com.microsoft.z3.Expr[])'
        at com.tsnsched.core.components.Port.setUpCycle(Port.java:1377)
        at com.tsnsched.core.nodes.TSNSwitch.setUpCycleSize(TSNSwitch.java:418)
        at com.tsnsched.core.schedule_generator.ScheduleGenerator.configureNetwork(ScheduleGenerator.java:159)
        at com.tsnsched.core.schedule_generator.ScheduleGenerator.generateSchedule(ScheduleGenerator.java:257)
        at UseCase.runTestCase(UseCase.java:453)
        at GenerateScheduleJavaInput.main(GenerateScheduleJavaInput.java:15)
mv: cannot move 'output.txt' to 'output/example.java.out': No such file or directory
mv: cannot stat 'log.txt': No such file or directory
mv: cannot stat 'output.json': No such file or directory
Ending execution

Is there an obvious mistake? I see that the installation script installs Java 8, but I haven't figured out what could be wrong.
Thank you for your help!

@MadeInPierre
Copy link
Author

MadeInPierre commented May 8, 2022

Well, I reverted your last commit on March 7th 7ac00ad for M1 compatibility and everything works fine now! Maybe there is something new that breaks compatibility for other systems? I am using a regular x86 PC with Ubuntu 22.04.

I will close this issue since it is (kindof) solved, but feel free to open it again in case you want to investigate about the last commit's effects.

@ACassimiro
Copy link
Owner

Hello @MadeInPierre! Sorry for reaching out so late, and thank you for figuring this out. I'm going to take a deeper look into it and should push a patch for fixing it in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants