Solved

Mocha Decompiler + CLASSPATH

Posted on 1997-10-11
6
686 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Way to decrease size of apk file 9 108
Desingning Refactoring existing code 2 31
pagenation logic how it is working in my code 1 71
Selenium docs api java index 3 66
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.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

749 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