• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to Register Jvm.dll

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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: https://coderanch.com/how-to/java/how-to-create-java-program
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic