PDA

View Full Version : javap commands in the terminal


Formz TSI
03-25-2002, 11:17 PM
Ok well i'm trying to extract the contents of .class file. Check this out...

[m11:~] matt% ls
Balloon.class LaunchBalloon.class Pictures plugins
Desktop Library Public
Documents Movies Send Registration
Icon? Music Sites

[m11:~] matt% javap -c ~/Balloon.class
Class '/Users/matt/Balloon.class' not found

that makes no sense to me whatsoever. ls finds the file, but the actual javap command can't! I have no idea what is going on. It seems like it'd be something blatently obvious and I can't seem to figure it out. Any help would be greatly appreciated. Thanks.

stetner
03-26-2002, 07:59 AM
Tryls -bwhich will show non-printable/control characters as octal.

Formz TSI
03-26-2002, 08:34 AM
-b doesn't seem to work..

[m11:~] matt% ls -b
ls: illegal option -- b
usage: ls [-1ACFLRSTWacdfgiklnoqrstux] [file ...]

stetner
03-26-2002, 08:50 AM
Sorry, I have :
i fileutils 4.1-3 Common shell commands like ls, touch, chmod

installed via fink. For th original OS X ls, the -q option will print a '?' where there is an unprintable character embeded in a file name. Not as nice, but it will show if you have a problem....

Formz TSI
03-26-2002, 09:15 AM
thanks. even now though the "balloon.class" is showing no none printable characters. I'm stumped as to why I can't find the file.

blb
03-26-2002, 08:24 PM
javap takes a class name, not a filename; try

javap -c -classpath ~ Balloon

Formz TSI
03-26-2002, 09:03 PM
now I'm VERY confused...

[m11:~] matt% javap -c ~/Balloon
Class '/Users/matt/Balloon' not found

I'm stumped.

bakaDeshi
04-09-2002, 01:11 PM
try this:

if your class file is in ~/Balloon.class
cd ~
javap -c Balloon

you don't add the .class, this is the same as using java to run the java app. you don't use the .class in the filename when running the command.

-bakaDeshi

Formz TSI
04-09-2002, 01:35 PM
i tried doing it without the .class extension and it still could not find it.

mervTormel
04-09-2002, 02:14 PM
i think blb had the correct incantation:

javap -c -classpath /path/to/theClass/ Balloon

classpath is a string of dirs. there is whitespace after the classpath, before the classFileName ( Balloon ). it's very particular.

bakaDeshi
04-09-2002, 02:21 PM
you shouldn't have to specify -classpath, at least mine works. if you're in the current directory, then javap classname should work. Sounds like Formz TSI may have a PATH issue. type env<return> or echo $PATH.

Someone else should verify this but it's my guess anyway.:)

-bakaDeshi