Solved

Mocha Decompiler + CLASSPATH

Posted on 1997-10-11
6
661 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
Comment Utility
Please list contents of MOCHA.ZIP.
0
 
LVL 2

Expert Comment

by:mgk
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 2

Author Comment

by:wboyd
Comment Utility
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
Comment Utility
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
Comment Utility
OK, here's an answer...
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now