Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic Question about main

 
Awais Sheikh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This could be because of the version of compiler and jvm is not same.

Have you installed two j2sdk on your machine.?
 
Avishek Banerjee
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Awais Sheikh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic