Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Silly newbie question, how do I get a custom package to work with .... 1

Status
Not open for further replies.

fenris

Programmer
May 20, 1999
824
CA
Currently this would be my second semester of java, so I have most of the basics down. We just learned about organizing class in to logical packages. I understand this. but I can't seem to get it to work with out specifying the <br>
-classpath switch. What I want is to set the environment variable so that I don't have to type it every time (I am lazy :) ). I am running windows 98SE, I have my path variable set properly, in a batch file that executes every time I start a command prompt session. that batch file looks like this:<br>
<br>
set PATH = %PATH%;c:\jdk1.2.2\bin<br>
set CLASSPATH = c:\java\cosc1047\lib REM where the package directory would be stored<br>
<br>
<br>
with this above setting, I can't get javac to find my <br>
packages. But it works if I go: javac -classpath c:\java\cosc1047\lib MyClass.java<br>
<br>
I have search java.sun.com, the internet, usenet and various other sources, and I tried every recomendation but to no avail.<br>
<br>
I am at a loss and this is really starting to bother me. Would putting the package into a jar file help?<br>
<br>
<br>
fenris
 
Have you tried putting the statements in your autoexec.bat file in your root directory?
 
try setting the classpath envirenment variable in autoexec.bat file<br>
yr entry should look like <br>
set classpath=%classpath%; c:\java\cosc1047\lib<br>
Although this is valid method for all versions of windows 95 and 98 only<br>
for other versions of windows there is a different method to set classpath(thro control panel)<br>
all the best<br>
<br>
<p>gaurav<br><a href=mailto:yadav_gaurav@yahoo.com>yadav_gaurav@yahoo.com</a><br><a href= > </a><br>
 
Give this a quick try. Unfortunately I am not currently at a location where I can test it:<br><br>javac -classpath %CLASSPATH% MyClass.java<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top