wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Unable to Register Jvm.dll Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Unable to Register Jvm.dll" Watch "Unable to Register Jvm.dll" New topic
Author

Unable to Register Jvm.dll

Kenny Li
Greenhorn

Joined: Aug 07, 2011
Posts: 7
Hi there, I'm a nooby in the world of programming, but I am very interested in the idea of it - I need some advices! I'm learning from the book "Head First Java, 2nd Edition" and downloaded jdk1.6.0_26. I have just started chapter 1 and just got the "Party.java" compiled. Unfortunately, I am not able to register Jvm.dll; however, when I tried to register it, it will have this message pop up:
"Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .Dll files" "The specified module could not be found."

Please spare me some advices/inputs, thank-you!


-Ken


***Edit: I have Eclipse downloaded also.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Welcome to the Ranch!

You shouldn't need to register it manually. If you installed the JRE (either a standalone or one that comes with the JDK) correctly that should have been done for you.

Just try to run your Java commands. If that fails due to a problem with jvm.dll I suggest you reinstall your JRE / JDK.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38062
    
  22
Assuming you have compiled Party, you have your PATH set correctly. That is all you have to do.

Beware: Party is incomplete and can't be executed as it stands in the book.
Kenny Li
Greenhorn

Joined: Aug 07, 2011
Posts: 7
Rob Spoor wrote:Welcome to the Ranch!

You shouldn't need to register it manually. If you installed the JRE (either a standalone or one that comes with the JDK) correctly that should have been done for you.

Just try to run your Java commands. If that fails due to a problem with jvm.dll I suggest you reinstall your JRE / JDK.


Hi Rob, I have reinstalled the JDK; however, the same problem prevails. Is there any other solutions?

Thank-you for notifying me Campbell, I'll work with the moose code once I get my jvm.dll working.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38062
    
  22
Where are you registering it? Is that registering as a user with Oracle? As Rob has told you, there is no need to register anything anywhere. As I told you, all you need to do is set the PATH and you must have done that to get anything to compile.

Please explain what you are doing, because I suspect you are trying something unnecessary.
Kenny Li
Greenhorn

Joined: Aug 07, 2011
Posts: 7
Campbell Ritchie wrote:Where are you registering it? Is that registering as a user with Oracle? As Rob has told you, there is no need to register anything anywhere. As I told you, all you need to do is set the PATH and you must have done that to get anything to compile.

Please explain what you are doing, because I suspect you are trying something unnecessary.


Sorry for being vague, let me explain; I have compiled and created a .class file. Based on what I found on Google, I should be opening .class files with the application "jvm.dll" - I may not be correct. Next, I right clicked the "MooseGreetings" class file and picked "open with..." to browse for "jvm.dll", and I was unable to find it. Therefore, I went to search the jvm.dll in the Jdk directory and right click on "jvm.dll" and selected the "Register this component(R)," which resulted with the pop-up message: "Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .Dll files" "The specified module could not be found."

My whole goal is trying to execute the class file I created, but I have no idea whether I am doing it right...I really appreciate the helps.


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38062
    
  22
You don't usually "open" .class files, you try to run them. You need to run whichever class has the main method in, and that should use all the other classes, directly or indirectly.

You would write
javac Party.java
... which you obviously have already done. Note the absence of any "finished" messages, which you take as meaning success. If there are any errors found, there will be lots of messages.
Then to execute Party you write
java Party
... omitting any extensions, a feature which catches many beginners out. Then you get an error because (as I hinted earlier) the Party class as given lacks a main method, so it cannot be executed directly. It will probably work better if you substitute MooseGreetings for Party throughout

Please give us a link to whatever you found on Google; you have either misunderstood it or the link provides at best confusing information.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38062
    
  22
Note you need to be in the same directory as those files when you use those commands. Again you must have done that, or you wouldn't have got this far.
Kenny Li
Greenhorn

Joined: Aug 07, 2011
Posts: 7
Campbell Ritchie wrote:You don't usually "open" .class files, you try to run them. You need to run whichever class has the main method in, and that should use all the other classes, directly or indirectly.

You would write
javac Party.java
... which you obviously have already done. Note the absence of any "finished" messages, which you take as meaning success. If there are any errors found, there will be lots of messages.
Then to execute Party you write
java Party
... omitting any extensions, a feature which catches many beginners out. Then you get an error because (as I hinted earlier) the Party class as given lacks a main method, so it cannot be executed directly. It will probably work better if you substitute MooseGreetings for Party throughout

Please give us a link to whatever you found on Google; you have either misunderstood it or the link provides at best confusing information.


Oh man, it seems like I am doing it right and wrong at the same time. I've actually saved the "MooseGreetings.java" in my document folder and had it compiled by right clicking>open with...>browse>javac>open. I typed "javac MooseGreetings.java" in cmd, but it wouldn't compile which lead me to do what I did. Next, I tried moving the "MooseGreetings.java" to the java folder to compile, which resulted the same as well. So, instead, I copied the "MooseGreetings" class file I had in my documents folder to the Java folder and ran "java MooseGreetings", which resulted with this message: "Error: Could not find or load main class MooseGreetings"

I did not saved any links because I would usually read and head to other websites for infos. I am also using Windows Vista.

I've been using this link I found on the Javaranch forum: http://www.coderanch.com/how-to/java/how-to-create-java-program
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38062
    
  22
Advice I give regularly: when you open your command prompt, enter this command, once only
mkdir java
. . . or similar. Follow it with
cd java
. . . and use the same command next time you open the command line.
You now have a "java" folder in "My Documents" and you want to save your .java files there. Don't use NotePad, but look here for alternatives. Then you can use
javac MooseGreetings.java
java MooseGreetings
. . . to execute the file.
Kenny Li
Greenhorn

Joined: Aug 07, 2011
Posts: 7
Campbell Ritchie wrote:Advice I give regularly: when you open your command prompt, enter this command, once only
mkdir java
. . . or similar. Follow it with
cd java
. . . and use the same command next time you open the command line.
You now have a "java" folder in "My Documents" and you want to save your .java files there. Don't use NotePad, but look here for alternatives. Then you can use
javac MooseGreetings.java
java MooseGreetings
. . . to execute the file.


Thank-you Camp! I followed your directions exactly and it's finally working on my laptop. Weirdly, it's still not working on my desktop (the computer I first tried on). I guess my desktop is screwed up somewhere (oh well, haha). Is there a way to get a "Mooooo..." animated message to pop up when I execute the .class file or is it bound inside the cmd? Again, thank you very much!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38062
    
  22
Yes, of course you can get a Mooo popup or animation. But that is a long way beyond the level of using a MooseGreetings class; you have lots to learn before you can achieve that. MooseGreetings is simply a different version of a Hello World class.

Don't call me Camp.

Well done getting it working. Please tell us what the errors on the desktop are.
I can't see anything about .dll files on our "how to run your first ..." FAQ page which you quoted earlier.
Kenny Li
Greenhorn

Joined: Aug 07, 2011
Posts: 7
Campbell Ritchie wrote:Yes, of course you can get a Mooo popup or animation. But that is a long way beyond the level of using a MooseGreetings class; you have lots to learn before you can achieve that. MooseGreetings is simply a different version of a Hello World class.

Don't call me Camp.

Well done getting it working. Please tell us what the errors on the desktop are.
I can't see anything about .dll files on our "how to run your first ..." FAQ page which you quoted earlier.


Alrighty, time for me to move on. I still don't get where the problem lies on my desktop; oh well, I'll be going to college soon with my laptop anyway, haha. I did not use the FAQ page about the .dll files; it was some other link I found on Google. I really appreciate your help, thank-you sir!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38062
    
  22
Please give us the link you found, so we can decide whether it is any good or not.
Please tell us the errors you are getting on your desktop. We have probably seen them before ourselves.
Kenny Li
Greenhorn

Joined: Aug 07, 2011
Posts: 7
Campbell Ritchie wrote:Please give us the link you found, so we can decide whether it is any good or not.
Please tell us the errors you are getting on your desktop. We have probably seen them before ourselves.


Ok, I've found it; the first post on this link got me confused: http://forums.oracle.com/forums/thread.jspa?threadID=1015045
When the guy said he was unable to launch Java Virtual Machine by clicking jvm.dll, I thought .class files are executed by opening with jvm.dll.

On my desktop, it all worked fine from mkdir java>cd java, but stopped at java MooseGreetings with the message "Error: could not find or load main class MooseGreetings"
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38062
    
  22
About the only post in that Oracle forum discussion which was at all helpful was the last one telling you how to install Java™. Which is the same as on our "first program" FAQ. I have no idea where they got jdk.dll from.
If you have a "can't find file" problem, go to your "java" directory and try the dir command, or use the explorer to find the file. In explorer, go into "folder options" and remove the option "hide extension for common types". See whether the file is actually in that directory, and whether it is correctly named with the correct extension.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to Register Jvm.dll
 
Similar Threads
JVM Crash within native method
I wanna know abt ANT
JNI_CreateJavaVM returns with -1
I wanna know abt ANT
Comm Port opening?