Javap Error Could Not Find
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company install javap Business Learn more about hiring developers or posting ads with us Stack Overflow Questions
Javap Command Example
Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million javap download programmers, just like you, helping each other. Join them; it only takes a minute: Sign up I get “Error: class not found” when trying to use javap up vote 0 down vote favorite I'm trying to view javap jar the bytecode of my class but doesn't find the class even though the .class file is there. I can compile the Main.java file just fine from the CLI but when using javap -c Main it doesn't find the class. public class Main { public static void main(String args[]) { int Y = 0; int X = (Y + 4) * 3; } } java javap share|improve this question edited Feb 9 '13 at 22:03
"javap" Is Not Recognized
Pshemo 70.8k1087131 asked Feb 9 '13 at 17:04 Schwarz 110112 Are there any other actions you've done? Just typing your commands from one console works fine for me. –madhead Feb 9 '13 at 19:19 No package? Classpath is correct? –Dave Newton Feb 9 '13 at 19:33 @DaveNewton do you remember about default package? :) –madhead Feb 9 '13 at 19:39 @madhead Yes. I'm asking if there is in fact no package, and if the classpath is correct; obvious questions when there's a classpath issue. –Dave Newton Feb 9 '13 at 19:47 @DaveNewton I've tested this code. It is good without the package. And javac/javap works too. –madhead Feb 9 '13 at 19:48 | show 4 more comments 1 Answer 1 active oldest votes up vote 3 down vote If the class is in the default package, and if you are in the directory where the Main.class file is, the use javap -cp . -c Main If your class is in the package com.foo.bar, then go th the directory where the Main.class file is (bar), then execute the following commands: bar> cd .. foo> cd .. com> cd .. > javap -cp . com.foo.bar.Main share|improve this answer answered Feb 9 '13 at 22:38 JB Nizet 401k31529704 add a comment| You
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company decompile java class Business Learn more about hiring developers or posting ads with us Stack Overflow Questions javac is not recognized Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Java cannot find the class file, while javap can up vote 2 down vote favorite I have compiled a class (called http://stackoverflow.com/questions/14790494/i-get-error-class-not-found-when-trying-to-use-javap Test.class) using the Java ASM library. I decided to try and ensure that I had properly compiled the class by attempting to run it using the "java" command. However, when I did this, I got the "Could not find or load main class Test" messsage. I thought this was strange, since the class is inside the current working directory (I had also tried passing "." as the classpath, but to no avail). I then http://stackoverflow.com/questions/31392751/java-cannot-find-the-class-file-while-javap-can tried dissassemblng it with "javap", which worked perfectly, this is strange since if javap can find the class file, then surely java should also be able to? Here is my command line input and output: $ javap -c Test Compiled from "Test.ash" public class Test { public Test(); Code: 0: aload_0 1: invokespecial #9 // Method "java.lang.Object"."
details. Win a copy of Penetration Testing Basics this week in the Security forum! Post https://coderanch.com/t/446403/java/java/newbie-javap-ERROR-find-TalkingClock Reply Bookmark Topic Watch Topic New Topic programming forums Java Java JSRs Mobile Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers Other http://forums.codeguru.com/showthread.php?525103-Error-Could-not-find-or-load-main-class all forums Forum: Beginning Java [newbie] javap ERROR:Could not find TalkingClock$1TimePrinter.class Jon Camilleri Ranch Hand Posts: 664 I like... posted 7 years ago I'm is not trying to use the following commands: C:\Users\Administrator\Desktop\Java_console>dir Volume in drive C has no label. Volume Serial Number is 982D-F9F4 Directory of C:\Users\Administrator\Desktop\Java_console 05/21/2009 05:29 PM
Forum Java Programming Java Programming Error: Could not find or load main class If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register or Login before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 4 of 4 Thread: Error: Could not find or load main class Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode June 28th, 2012,04:53 PM #1 NTL View Profile View Forum Posts Member Join Date Apr 2009 Posts 47 Error: Could not find or load main class After cleaning my Eclipse workspace I now get the error: "Error: Could not find or load main class" when I try to run any project that existed before cleaning. If a create a new project it runs as expected. I have checked all run configurations and they are indeed pointing to the correct project and main class, however Eclipse still claims this error. What could have possibly gone wrong? Thanks. Reply With Quote June 29th, 2012,04:12 AM #2 AlbertGM View Profile View Forum Posts Member Join Date Nov 2006 Location Barcelona - Catalonia Posts 364 Re: Error: Could not find or load main class Did it work before cleaning your workspace? Occasionally eclipse gets crazy, so try to restart it. It's difficult to say without any other information. You can also click on run manager (Button "run..." in "run" menu), where you can watch whether project, main class, classpath,.... are correct. You can also try to compile and run from command line, or give us more information Albert. Please, correct me. I'm just learning.... and sorry for my english :-) Reply With Quote June 29th, 2012,09:32 AM #3 NTL View Profile View Forum Posts Member Join Date Apr 2009 Posts 47 Re: Error: Could not find or load main class Originally Posted by AlbertGM Did it work before cleaning your workspace? Occasionally eclipse gets crazy, so try to restart it. It's difficult to say without any other information. You can also click on run manager (Button "run..." in "run" menu), where you can watch whether project, main class, classpath,.... are correct. You can also try to compile and run from command line, or give us more information Albert. 1.) Yes, it did execute as expected before cleaning the workspace. I have tried restarting Eclipse, but that did not work. 2.) The project, main class and classpath are se