473,320 Members | 1,902 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

java CLASSPATH Environement var

hi, i'm new to java, and using sun last JDK, and i'm trying to understand
how work this feature when we want to compile at command line ? i'm trying
to set the classpath to the directory of the package but still always not
working!
thank's.

--
AbdelHalim MIMOUNI
Jul 18 '05 #1
4 6526
Abdelhalim MIMOUNI wrote:
hi, i'm new to java, and using sun last JDK, and i'm trying to understand
how work this feature when we want to compile at command line ? i'm trying
to set the classpath to the directory of the package but still always not
working!
thank's.


The best way to get an answer to your question is to post everything you
can. Post the exact command line you are using, the output from it.
Post your directory structure, and which files exist where. In your
case, post the package declaration of your java source files as well.

Ray

--
XML is the programmer's duct tape.
Jul 18 '05 #2
//the super classe

package myPackage;

public class firstClass

{
//class data
int dataField_One;
int dataField_Two;

public firstClass ()

{

//constructor declaration

}

} //end firstClass

---------------------------------------------

package myPackage;

import java.awt.*;

public class DrawClass extends firstClass
{
//class data

//private declaration
//methods
//constructors
public DrawClass()// constructor

{

//constructor declaration

}

//other declarations

} //end DrawClass

----------------------------------------------
my directory files located in the directory named as the package name is:

myPackage.

The files are: firstClass.java(the super classe) and DrawClass.java

And my command line command is a follow:

D:\DOCUME~1\MASTERPOINT\My Documents\Cours\Java\Pers
Teach\Prope_Obj\myPackage>set CLASSPATH=.;D:\DOCUME~1\MASTERPOINT\My
Documents\Cours\Java\Pers Teach\Prope_Obj\myPackage;

DrawaRect.java:10: cannot resolve symbol

symbol : class firstClass

location: class figure.DrawaClass

public class DrawaClass extends firstClass

^

DrawaRect.java:70: cannot resolve symbol

symbol : variable width

location: class myPackage.DrawaClass

02 errors


--
AbdelHalim MIMOUNI
"Raymond DeCampo" <no****@twcny.rr.com> a écrit dans le message de news:
T0******************@twister.nyroc.rr.com...
Abdelhalim MIMOUNI wrote:
hi, i'm new to java, and using sun last JDK, and i'm trying to understand how work this feature when we want to compile at command line ? i'm trying to set the classpath to the directory of the package but still always not working!
thank's.


The best way to get an answer to your question is to post everything you
can. Post the exact command line you are using, the output from it.
Post your directory structure, and which files exist where. In your
case, post the package declaration of your java source files as well.

Ray

--
XML is the programmer's duct tape.

Jul 18 '05 #3
Abdelhalim MIMOUNI wrote:
And my command line command is a follow:

D:\DOCUME~1\MASTERPOINT\My Documents\Cours\Java\Pers
Teach\Prope_Obj\myPackage>set CLASSPATH=.;D:\DOCUME~1\MASTERPOINT\My
Documents\Cours\Java\Pers Teach\Prope_Obj\myPackage;


Abdelhalim,

The problem is that you are including the name of the package in the
CLASSPATH. The javac and java programs will append the package name to
the CLASSPATH entries. So what you want is:

D:\DOCUME~1\MASTERPOINT\My Documents\Cours\Java\Pers
Teach\Prope_Obj\myPackage>set CLASSPATH=D:\DOCUME~1\MASTERPOINT\My
Documents\Cours\Java\Pers Teach\Prope_Obj;

HTH,
Ray

--
XML is the programmer's duct tape.
Jul 18 '05 #4
ok, it's working, so as i understand the classpath var should always be set
to the directory containing the package directory itself!
thank's

--
AbdelHalim MIMOUNI
"Raymond DeCampo" <no****@twcny.rr.com> a écrit dans le message de news:
aM*******************@twister.nyroc.rr.com...
Abdelhalim MIMOUNI wrote:
And my command line command is a follow:

D:\DOCUME~1\MASTERPOINT\My Documents\Cours\Java\Pers
Teach\Prope_Obj\myPackage>set CLASSPATH=.;D:\DOCUME~1\MASTERPOINT\My
Documents\Cours\Java\Pers Teach\Prope_Obj\myPackage;


Abdelhalim,

The problem is that you are including the name of the package in the
CLASSPATH. The javac and java programs will append the package name to
the CLASSPATH entries. So what you want is:

D:\DOCUME~1\MASTERPOINT\My Documents\Cours\Java\Pers
Teach\Prope_Obj\myPackage>set CLASSPATH=D:\DOCUME~1\MASTERPOINT\My
Documents\Cours\Java\Pers Teach\Prope_Obj;

HTH,
Ray

--
XML is the programmer's duct tape.

Jul 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Lem | last post by:
I get the error Exception in thread "main" java.lang.NoClassDefFoundError when I type java app2 in the command prompt. I've tried moving to the jre directory and typed java c:\app2\app2, but it...
8
by: Fu Bo Xia | last post by:
the java.lang.Object.forName method takes a java class name and returns a Class object associated with that class. eg. Class myClass = Object.forName("java.lang.String"); by if i only know the...
0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
2
by: dave | last post by:
(Forgive all caps... they are there to differentiate btw question and code) THIS IS THE ERROR I KEEP GETTING. IT COMPILES BUT WHEN IT RUNS, THE FOLLOWING POPS UP: Exception in thread "main"...
3
by: Bernd Oninger | last post by:
When I run the successfully compiled java source shown at the end I got a runtime error: Exception in thread "main" java.lang.NoClassDefFoundError: org/jdom/Content Where is the missing class ?...
7
by: Alex | last post by:
Hi all, I am trying to install a java stored procedure via the windows development centre. The linux box is running 8.1 FP4 as is the windoze platform. If I am on the linux box i can install...
2
by: ramasubramanian.rahul | last post by:
hi i am trying to call some java APIs from c . i use the standatd JNI calls to load the JVM from a c program and call all java functions by using a pointer to the jvm which was returned by the JNI...
6
by: =?Utf-8?B?VkIgSm9ubmll?= | last post by:
ASP.NET 2.0 / Visual Studio 2005 / VB.Net 2.0 I have a web interface that needs to launch a java application. What a long strange trip it has been... I am using Process.Start process start...
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.