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

[ERROR] Could not compile the generated mutants. Make sure that tools.jar is in your classpath. #25

Open
Danish-Nazir opened this issue Apr 21, 2022 · 2 comments

Comments

@Danish-Nazir
Copy link

Danish-Nazir commented Apr 21, 2022

I have tried to run Mujava in macOS and Windows.

In Mac:
I am having trouble with the config file and Tools.jar file.
Mujava is running but can't create any mutants.

In Windows:
when I tried to run it on Windows the config file shows C:\Mujava/classes "doesn't exist" in the error. Mujava_Home is set to "C:\Mujava" and "/classes" is added by Mujava. Why is it adding a forward slash in Windows setup and how do I change that.

Path to Tools.jar:
Screenshot 2022-04-21 at 12 13 41 PM

.bash_profile:
Screenshot 2022-04-21 at 12 13 49 PM

Mujava Home:
Screenshot 2022-04-21 at 12 17 12 PM

Mujava Config:
Screenshot 2022-04-21 at 12 21 05 PM

Java version:

Danishs-MacBook-Pro:mujava Danish$ java -version openjdk version "1.8.0_292" OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_292-b10) OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.292-b10, mixed mode)

Error:

`
The main method starts
[ERROR] Can't find mujava.config file
java.io.FileNotFoundException: /Users/Danish/MuJava/mujava.config (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.(FileInputStream.java:138)
at java.io.FileReader.(FileReader.java:72)
at mujava.MutationSystem.setJMutationStructure(MutationSystem.java:592)
at mujava.gui.GenMutantsMain.main(GenMutantsMain.java:67)
[ERROR] for class PartiallyTested => PartiallyTested (wrong name: com/example/PartiallyTested)
Warning: the fonts "Times" and "Lucida Bright" are not available for the Java logical font "Serif", which may have unexpected appearance or behavior. Re-enable the "Times" font to remove this warning.
Error in update() in TraditionalMutantsViewerPanel.java
Class HelloWorld.java has only the 'static void main()' method and no mutants will be generated.
Error in update() in TraditionalMutantsViewerPanel.java

All files are handled
File /Users/Danish/MuJava/src/PartiallyTested.java
[ERROR] Could not compile the generated mutants. Make sure that tools.jar is in your classpath.
You may also need to delete the mutants that were generated (but not compiled) in the result/ directory of the muJava installation.

java.lang.NoClassDefFoundError: com/sun/tools/javac/Main
at mujava.MutantsGenerator.compileOriginal(MutantsGenerator.java:528)
at mujava.MutantsGenerator.makeMutants(MutantsGenerator.java:107)
at mujava.gui.MutantsGenPanel.runB_mouseClicked(MutantsGenPanel.java:495)
at mujava.gui.MutantsGenPanel$4.mouseClicked(MutantsGenPanel.java:177)
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:270)
at java.awt.Component.processMouseEvent(Component.java:6542)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6304)
at java.awt.Container.processEvent(Container.java:2239)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4544)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.awt.Container.dispatchEventImpl(Container.java:2283)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: com.sun.tools.javac.Main
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 36 more
`

@Danish-Nazir
Copy link
Author

Danish-Nazir commented Apr 21, 2022

I fixed the "config file not found" error. I had to remove the .txt extension.

Still getting "[ERROR] Could not compile the generated mutants. Make sure that tools.jar is in your classpath."
Mutants are being generated but not compiled because Tools.jar is not available.

Also, there are no traditional_mutants being generated. I am receiving this error:
Error in update() in TraditionalMutantsViewerPanel.java

@jeffoffutt
Copy link
Owner

jeffoffutt commented Apr 21, 2022 via email

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