| Author |
Class file not being made
|
Hon Chan
Greenhorn
Joined: Apr 09, 2011
Posts: 2
|
|
Hello All,
I have just installed Java and am trying to get it setup. I've set the following as the Environment variables
PATH is C:\Program Files\Java\jdk1.6.0_24\bin
CLASSPATH is C:\Program Files\Java\jdk1.6.0_24\jre\bin
I can run javac and my program compiles. I can run javac and see all the options.
But no class file is being created.
I'm using Windows 7 64 bit, i've installed using the 64 bit installer. Its created this directory as well C:\Program Files\Java\jre6\bin
I've tried setting the CLASSPATH to this but still get same problem.
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16695
|
|
Two points...
1. CLASSPATH is for the root directories of you class files. It is *not* for you executables.
2. The compiler will place class files based on the packages it is in.
So... it would help if you tell us where the java files are located, from where you are running the compiler, and if your code uses packages.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Hon Chan
Greenhorn
Joined: Apr 09, 2011
Posts: 2
|
|
Thanks for the reply Henry,
The problem with the class file is now gone, I made a silly mistake, for some reason my Java file had not saved and it was just a blank file I was compiling.
Now the class file is being created but I still got the class not found exception. I found a workaround for the problem, java -classpath . [filename] lets me run the file.
I'm running javac from the directory I have my java files saved in.
|
 |
Greg Brannon
Bartender
Joined: Oct 24, 2010
Posts: 530
|
|
Hon Chan wrote:
I'm running javac from the directory I have my java files saved in.
That helps.
|
Learning Java using Eclipse on OpenSUSE 11.2
Linux user#: 501795
|
 |
 |
|
|
subject: Class file not being made
|
|
|