Solved

Mocha Decompiler + CLASSPATH

Posted on 1997-10-11
6
675 Views
Last Modified: 2013-11-23
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
Comment
Question by:wboyd
6 Comments
 
LVL 3

Expert Comment

by:eugenem
ID: 1228466
Please list contents of MOCHA.ZIP.
0
 
LVL 2

Expert Comment

by:mgk
ID: 1228467
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
 
LVL 1

Expert Comment

by:quekky
ID: 1228468
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
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
LVL 2

Author Comment

by:wboyd
ID: 1228469
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
 
LVL 3

Expert Comment

by:gwalters
ID: 1228470
mgk,

  Post something as an answer, instead of a comment, so wboyd
can grade it.
0
 
LVL 2

Accepted Solution

by:
mgk earned 170 total points
ID: 1228471
OK, here's an answer...
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
servlet  URL Rewriting 1 36
javap not working 8 44
web application structure 18 77
mysql jsp example issue 32 33
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question