[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Mocha Decompiler + CLASSPATH

Posted on 1997-10-11
6
Medium Priority
?
726 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 680 total points
ID: 1228471
OK, here's an answer...
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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 video teaches viewers about errors in exception handling.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

650 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