[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 740
  • Last Modified:

Mocha Decompiler + CLASSPATH

My applet class resides at D:\JWS2\JDK\BIN. The Mocha Decompiler class  lives in a zip file which I have placed in D:JWS2\JDK\LIB

I'm using the JDK 1.1. JVM in Sunsoft's Java Workshop 2 beta for Windows 95. I'm trying to run the Mocha decompiler on MyAppletClass like so:

D:\JWS2\JDK\BIN>java mocha.Decompiler MyAppletClass

I get the error message "Can't find class mocha/Decompiler" (forward slash in W95?) when I know I've pointed CLASSPATH at the mocha.zip file which holds the Decompiler like so:


SET
PATH c:\windows;c:\windows\COMMAND;C:\TCPDOS\BIN;C:\MWW\DLL;C:\MWD\MANAGER;C:\PS1TOOLS;D:\JWS2\JDK\BIN

SET CLASSPATH =.;D\JWS2\JDK\LIB\CLASSES.ZIP;D\JWS2\JDK\LIB\MOCHA.ZIP;D:\JWS2\JDK\BIN



I have tried

1) several permutations of the CLASSPATH variable
2) overriding the CLASSPATH variable with -classpath (path)
3) moving the mocha.zip file to different directories
4) uninstalling an older standalone JDK 1.1 from a different partition
5) unzipping the mocha.zip file to expose it's innards directly to java
6) installing an alternative decompiler (Mocha's halfsister, Jasmine)
7) redownloading and reinstalling a second copy of the mocha.zip file


etc, etc...

If I change the current directory from \BIN to \LIB and place MyAppletClass in the \LIB directory along with both mocha.zip and classes.zip and type:

D:\JWS2\JDK\LIB>javajava -classpath d:\Jws2\jdk\lib\classes.zip;.;d:\Jws2\jdk\lib\mocha.zip;mocha.Decompiler MyAppletClass

I then get the "In class myAppletClass: void main(String argv[] is not defined". Which I gather means it at least now sees both mocha/Decompiler and MyAppletClass but instead of decompiling it it tries to run the applet. Doing the same command on MyApplicationClass sure enough starts the application running but not mocha.Decompiler as intended.

What gives? Am I doomed to Carpal Tunnel Syndrome from having to type so much malarky whenever I wanna run a third party class ;) From what I read in reviews Mocha is suppose to be the cat's pyjamas.

What am I doing wrong? Maybe it's absolutely necessary that I put the JVM in a C:\ directory? Do I need to put more/less stuff in autoexec.bat? Maybe all I need to do is just use WingDis or DejaVu instead?

I'm wboyd@clara.net if its convenient for you to reply by email. I will glady post a summary of email replies. Thanks in advance.

Later!
0
wboyd
Asked:
wboyd
1 Solution
 
eugenemCommented:
Please list contents of MOCHA.ZIP.
0
 
mgkCommented:
I have used mocha and had few problems getting it to work. Your answer may actually be in here. Here's the deal:

1. I added the mocha.zip to the classpath, so my classpath looks like this now;
set classpath=".;E:\jdk1.0.2\lib\classes.zip;E:\Java\;E:\Java\mocha\Mocha.zip;"

2. Use this from the command line;
java mocha.Decompiler "E:\Java\xxxx.class"

After that a file called xxxx.mocha appears in the directory where the class file is.

I've also just tried it from the command line as this and get no problems;
E:\Java\mocha>java -classpath ".;E:\jdk1.0.2\lib\classes.zip;E:\Java\;E:\Java\mocha\mocha.zip;" mocha.Decompiler "E:\Java\ImageFader.class"

The important thing here is that the class file still has ".class" on the end of it (it doesn't in your example). Also note that it's all JDK 1.0.2, not higher.
0
 
quekkyCommented:
I'm using JDK 1.1 for win95

java -classpath d:\jdk1.1\bin\mocha\mocha.zip;d:\jdk1.1\lib\classes.zip;%classpath% mocha.Decompiler %1 %2 %3 %4 %5

This can run, without any problem
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
wboydAuthor Commented:
Thanks both mgk and quekky.  Shortly after I posted the question I re-read Mocha's README instructions and finally got it to work  after I realized I needed to include the extension. But I was still using the -classpath switch with the rather verbose path arguments. mgk's answer on using the command line is pretty much what I was aiming for. Thanks bud! I knew it would be something simple. The points are yours mgk. The system isn't giving me any option to credit them to you though. I'll wait and see in a little while. Later.
0
 
gwaltersCommented:
mgk,

  Post something as an answer, instead of a comment, so wboyd
can grade it.
0
 
mgkCommented:
OK, here's an answer...
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now