File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring 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: 11917

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: 45277
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.
Consider Paul's rocket mass heater.
subject: Get first application running
It's not a secret anymore!