File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Get first application running Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Get first application running" Watch "Get first application running" New topic
Author

Get first application running

Patrick Smith
Ranch Hand

Joined: Oct 08, 2007
Posts: 35
Hi,
i am new to Java and have problems running my first application. Here's what i did:
- jdk and jre are installed,
- i've set the path variabe as prescribed
- i wrote a small programm, this one:

public class meineersteanwendung {
public static void main (String[] args) {
System.out.println("Ich hersche!");
System.out.println("´┐Żber die Welt");
}
}

- when i execute the javac command, it's all ok, my .class file gets created.
- but then, when i want to start "java meineersteanwendung.java", it tells me the following:

C:\Documents and Settings\Patrick\MyDocuments\Patrick\Aarbecht\Programming\Java
\Java VKBF\Self>java meineersteanwendung.java
Exception in thread "main" java.lang.NoClassDefFoundError: meineersteanwendung/java

Any idea what to check for?
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11256
    
  16

when you start java, you give it the name of the class, not a name of a file. So, your command should be

java meineersteanwendung


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38481
    
  23
Welcome to the Ranch.

There is a list of common errors here. The mistake is adding the extension. Try
java meineersteanwendung
rather than
java meineersteanwendung.java
CR
Patrick Smith
Ranch Hand

Joined: Oct 08, 2007
Posts: 35
that was it, thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Get first application running