Konloch / Konloch/bytecode-viewer
No sources given error while running from command line
- Dominant language
- Java
- Stars
- 15.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
I tried to run BCV from command line to decompile some jars but kept running into `error: no sources given` message.
After getting into the source code and running it in debug mode I have noticed that this line of code
```java
JarUtils.saveAsJarClassesOnly(BytecodeViewer.getLoadedClasses(), tempZip.getAbsolutePath());
```
runs before BCV has loaded any classes as it is happens in `BytecodeViewer::openFiles()`.
After changing the code in that way I got decompilation from command line working
```java
BytecodeViewer.openFiles(new File[]{input}, false);
Thread.sleep(5 * 1000);
JarUtils.saveAsJarClassesOnly(BytecodeViewer.getLoadedClasses(), tempZip.getAbsolutePath());
```
Is this a bug or am I using CLI in some wrong way?
Contributor guide
Assessment
This issue has not been assessed yet.