aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Basic Question about main Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Basic Question about main" Watch "Basic Question about main" New topic
Author

Basic Question about main

Awais Sheikh
Ranch Hand

Joined: Jun 07, 2006
Posts: 48
I have installed jdk and I m placing my class files or packages in c:/java/bin/. I created another folder on c: root and placed my class files in c:/javaPrep folder. Classes are compling successfully but when i try to run the class file it give me message that


But when I places this package containing test12.java in bin folder it works fine. I have added already c:/javaPrep in classpath. but not working.
Please guide me how to do this.

Thanx
Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809
This could be because of the version of compiler and jvm is not same.

Have you installed two j2sdk on your machine.?


Asking Smart Questions FAQ - How To Put Your Code In Code Tags
Avishek Banerjee
Greenhorn

Joined: Jul 11, 2006
Posts: 17
If your package's directory structure is like c:->test->javaprep, then the class path should be only upto test. Don't include javaprep. In your case the classpath should have only c:\. Classpath should always mention the parent direcroty of the package directory. But, still the runtime error looks strange. It should acuatlly be . Anyways, try this.


Avishek<br />SCJP 5.0 - 90%
Awais Sheikh
Ranch Hand

Joined: Jun 07, 2006
Posts: 48
Thanks a lot for your helping replies

@Naseem
Thats the problem you are right. Actually on my system oracle is installed as well. Now I checked version of java and javac as below as showing 2 different version



So thats why .class file was not running. Now my confusion is clear. Thanx a lot your prompt and helpfull answer.

@Avishek
Thats not the problem Mr. Naseem pointed out the right point. thanks for your reply.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Basic Question about main