🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15875

Re: Executing a Class

#15875
From: Pavel Hlavnicka
Date: Mon, 26 Apr 1999 00:00
42 lines
1539 bytes
Hi,
JVM doesn't include the current directory into classpath.
Just write this

java -cp . Sender

where dot means current directory.

Pavel

Peter wrote:
> 
> To all,
> 
> I created a class file as follows;
> 
> public class Sender {
> 
>   public Sender() {
>   }
> 
>   public static void main(String[] args) {
>     Sender sender = new Sender();
>     sender.invokedStandalone = true;
>     System.out.println("Hello Everybody");
>   }
>   private boolean invokedStandalone = false;
> }
> 
> next, from the dos prompt in the directory where the class file resides
> I attempt to execute and I get the following errors,
> 
> e:\jdk1.2\bin\java Sender
> Exception in thread "main" java.lang.NoClassDefFoundError Sender
> e:\jdk1.2\bin\java Sender.class
> Exception in thread "main" java.lang.NoClassDefFoundError Sender\class

-- 
Pavel Hlavnicka
A.S.E.I. Ltd; Prague
tel.: +420 2 24106102
e-mail: pavel@asei.cz
Technical Details
Message-ID: <37242102.A4299637@asei.cz>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3723DB01.B6F769A5@worldnet.att.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,7e17397178c4a782
X-Google-Attributes: gidf74b3,public
From: Pavel Hlavnicka <pavel@asei.cz>
Subject: Re: Executing a Class
Date: 1999/04/26
Message-ID: <37242102.A4299637@asei.cz>
X-Deja-AN: 470959174
X-NNTP-Posting-Host: inet.asei.cz
Content-Transfer-Encoding: 7bit
References: <3723DB01.B6F769A5@worldnet.att.net>
X-Accept-Language: cs,en
Content-Type: text/plain; charset=iso-8859-2
Organization: Ceske Vysoke Uceni Technicke, Praha
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language