excuse me if this is a stupid thing to ask but its causing me quite a bit of headache.
In the past when I have installed the jdk i get a CLASSPATH environment variable that i can set and what not…
recently when I got a new computer and installed java 1.5.0_04 I went to set CLASSPATH and found nothing there…the java install had set nothing up…I only have the usual PATH variable…
i can run the java,javac,javadoc command from the command line even though i havent set at classpath or path.
Is it a recent change that java does not create a CLASSPATH environment variable?..even when i go and set CLASSPATH myself it doesnt have the effect of being the CLASSPATH
…thanks in advance for any help.
I don't believe it ever has actually.
Depending on what OS you are on this can be pretty easy to configure. I'm assuming you're on Windows XP so you should be able to configure the CLASSPATH by right-clicking on "My Computer" either on the Desktop or in the Start button and clicking "Properties". Once you are in there you can click on the tab labeled, "Advanced" and at the bottom of the page you should see a button called "Environment Variables". If you click on that a new window will appear with two lists of environment variables. The first is for your specific user that is currently logged in and the other is for the system (no matter who is logged in). It is generally best to put it your variables in your System variables unless you have a good reason to do otherwise.
So click "New" and type "CLASSPATH" for your Variable name and then for your variable value you'll want to start it with "." and separate all of your values with ";".
Personally, I never set my CLASSPATH anymore as I handle all of that in my IDE (Eclipse) instead and then worry about the classpath issues when I get around to releasing something to the public.
Hope this helps,
darkfrog
thanks for the reply, but let me clarify…I have set CLASSPATH…and I isnt acting as the classpath…by that i mean its acting like i didnt set the classpath. At this point i think my jdk install might be corrupt somehow…I dont know how man people could be having this problem.
anyway, for now i`ll just set it in eclipse i guess.
Well, like I said previously I think setting your global CLASSPATH variable is a bad idea anymore. Generally it's a better idea to specify it in your IDE and then when you release a game provide your jars in a lib directory with a command-line classpath definition.
As far as your classpath not acting like it should, make sure that you have the "." at the beginning as this is the root of many classpath issues. I don't know how many times I've been helping a developer debug their classpath issues and it be resolved by that simple little dot. :o
darkfrog