Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javap file question

 
Jose Manuel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
After applied:
jar xf Serialio.jar
I was able to see that it had classes files. My question is:
1. Is it possible to get the source code of this classes with javap application? I have tried to do it:
javap SerialConfig.class
but the message was:
"Error: Binary file 'Serial Port' contains Serialio.SerialPort"
Could anybody help me please?
Thanks in advance.
Jose.
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The command should be
javap SerialConfig
not
javap SerialConfig.class
 
Jose Manuel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With "javap SerialConfig" the result has been the same:
Error:Binary file 'SerialPort' contains Serialio.SerialPort
Jose
 
Jose Manuel
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could anybody help me with this please?
Thanks in advance.
Jose.
 
marilyn murphy
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ran into the same problem when trying to use javap on a class in the JDK source code.
 
Marilyn de Queiroz
Sheriff
Posts: 9063
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you set your classpath to the beginning of the package hierarchy and specify the full package name.
Ex.
C:\java\myProject>javap -classpath ../ myProject.myClass
or
C:\java>javap -classpath . myProject.myClass
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic