This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt on-line!
See this thread for details.
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

Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Get first application running" Watch "Get first application running" New topic

Get first application running

Patrick Smith
Ranch Hand

Joined: Oct 08, 2007
Posts: 35
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", it tells me the following:

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

Any idea what to check for?
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11876

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

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

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

Joined: Oct 08, 2007
Posts: 35
that was it, thanks.
I agree. Here's the link:
subject: Get first application running
jQuery in Action, 3rd edition