The Artima Developer Community
Sponsored Link

Java Answers Forum
Setting Classpath

1 reply on 1 page. Most recent reply: Dec 4, 2003 6:01 AM by Matthias Neumair

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
prasu

Posts: 1
Nickname: prasu
Registered: Dec, 2003

Setting Classpath Posted: Dec 2, 2003 2:55 PM
Reply to this message Reply
Advertisement
Hi
i have a package called mypackage2. I have 3 files in it called interface.java, blogic.java, form.java. all these three files belong to the same package mypackage2. I am calling blogic.java from interface.java. I am using jdeveloper10g as IDE. It works well when i execute and compile them
But it sucks when i try dos prompt. I have created mypackage2 directory under c:\. I placed all three files in c:\mypackage2 directory, I have set classpath set classpath=.;c:\;C;\mypackage2; .now it works well when i execute javac interface.java.

It displays error when i execute java interface.java saying that "noclassdeffounderror". It executes well when i java mypackage2.interface..

Can anyone helpme

i wasted whole of my day to fix it

Thanks in advance


Matthias Neumair

Posts: 660
Nickname: neumi
Registered: Sep, 2003

Re: Setting Classpath Posted: Dec 4, 2003 6:01 AM
Reply to this message Reply
There is no error.
You can't call "c:\myPackage\java.exe interface".
Only "c:\>java.exe myPackage.interface" works.
(or "c:\>java.exe -cp . myPackage.interface", in case you have problems with the classpath).

The full classname is NOT "interface", but "myPackage.interface". Only classes of the same package recognize "interface" as "myPackage.interface".

I think
"c:\myPackage>java.exe -cp c:\ myPackage.interface"
might work, too.

But as you see, I had to include the package in the call.
If you want to use
"c:\myPackage\java.exe interface"
the class interface must not be part of a package.

Flat View: This topic has 1 reply on 1 page
Topic: create an application like calc.exe Previous Topic   Next Topic Topic: java class files

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use