problem with JVM
I want to know how to start a .class file from the JVM!!!
I tried to write in the console: "java (.class file)" but it gives me an exception about an error in the class definition, i think!
By the way, i'm running windows xp.
: I want to know how to start a .class file from the JVM!!!
: I tried to write in the console: "java (.class file)" but it gives me an exception about an error in the class definition, i think!
: By the way, i'm running windows xp.
Which command exactly did you give? Some beginners (forgive if you're not) tend to write [b]java Filename.class[/b] or (worse) [b]java Filename.java[/b] instead of [b]java Filename[/b]. You should also recompile everything in place (on fails: compile some files manually it may help because the dependencies sometimes get screwed up). Finally, check if there is a main method in the class you're trying to execute.
I used the right command and there is a main. I don't know what to do. I'm not a beginner with java, but i always used the compiler (jbuilder), and i never tried before to do this. But now i had a .class compiled with netbeans, and i can't run it with jbuilder.
The error is this:
Exception in thread "main" java.lang.NoClassDefFoundError: Echo (wrong name: prova/Echo)
and then 12 lines of "at".
I found the code of this simple class on a site that explain how to use JVM, so i suppose that is correct.
I hope you can understand what is my problem!!!
I think you should run:
Dot instead of slash that is.
don't work!!! but know i've noticed that it gives me the same error even if a try to start an application from the compiler!!! is it possible that the problem is windows xp?
: don't work!!! but know i've noticed that it gives me the same error even if a try to start an application from the compiler!!! is it possible that the problem is windows xp?
I don't really get what you mean by starting an application from the compiler: that's not what compilers are made for. Java and XP should not be a problem: it's fine over here. But you should check Sun's website (java.sun.com), they have stuff on these problems. Also search for posts here on the forum on the same subject, we've discussed this problem before.
I've tried many things to start a .class, but i never success. It seems that the JVM can't find the right libraries. Forget about the compiler, it was my fault. Now this is the command of the compiler:
C:jbuilder5jdk1.3injavaw -classpath "C:Documents and SettingsHellFighterjbprojectprovaclasses;C:jbuilder5libeansipworks.jar;C:jbuilder5jdk1.3demojfcJava2DJava2Demo.jar;C:jbuilder5jdk1.3jrelibi18n.jar;C:jbuilder5jdk1.3jrelibjaws.jar;C:jbuilder5jdk1.3jrelib
t.jar;C:jbuilder5jdk1.3jrelibsunrsasign.jar;C:jbuilder5jdk1.3libdt.jar;C:jbuilder5jdk1.3lib ools.jar" prova.finestra
and it works! But if i cancel the classpath attribute, it says that he can't find the main class!!!! What does that mean?
The .class with the main function is in: C:Documents and SettingsHellFighterjbprojectprovaclassesprova
and the package name is: prova.
I'm sorry for my english, but i'm italian!!
Try this command java -cp . and then the main class file.
It looks like you're new here. If you want to get involved, click one of these buttons!
Assembly Code Share
Getting started in assembly
C and C++
C/C++ on Linux/Unix
C/C++ Windows API
C++ Game Development
Delphi and Kylix
Java Server Pages
Access databases and VB
Advance Visual Basic
DirectX Game dev
Newbie Game Programmers
Cooling & Overclocking
Database & SQL
Sound & Music
FreeLance Software City
C# & VB.NET School Support
Join the Team
Comments on this site
New programming languages
Off topic board
Mobile & Wireless
Operating Systems & Platforms
Witsbits Go Cloud
Embedded / RTOS
Windows CE & Pocket PC
Networking And Security
Windows 2003 Server
RUP & UML
Quality & Testing
Active Server Pages
HTML & WEB-Design
Mobile Internet & Messaging
WEB-Services / SOAP
In this Discussion