The Artima Developer Community
Sponsored Link

Java Answers Forum
Error in Running the class

1 reply on 1 page. Most recent reply: Apr 29, 2002 12:20 AM by Thomas SMETS

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
Budi Handoko

Posts: 4
Nickname: woodyround
Registered: Apr, 2002

Error in Running the class Posted: Apr 24, 2002 5:15 AM
Reply to this message Reply
Advertisement
Hi there.
I have got a problem here.
I have compiled a file from QuickTime Java Demo.
And after compilation, I tried to run it, but it is not able to run. Does anybody know what is the problem?
The script is below:
/*
 * QuickTime for Java SDK Sample Code

   Usage subject to restrictions in SDK License Agreement
 * Copyright: ? 1996-1999 Apple Computer, Inc.

 */
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.io.IOException;
 
import quicktime.*;
import quicktime.io.*;
import quicktime.qd.*;
import quicktime.std.*;
import quicktime.std.movies.*;
import quicktime.std.movies.media.*;
import quicktime.app.display.*;
import quicktime.app.players.*;
 
public class PlayMovie extends Frame implements Errors {	
	public static void main (String args[]) {
		try { 
			QTSession.open();
			// make a window and show it - we only have one window/one movie at a time
			PlayMovie pm = new PlayMovie("QT in Java");
			pm.show();
			pm.toFront();
		} catch (QTException e) {
			// at this point we close down QT if an exception is generated because it means
			// there was a problem with the initialization of QT>
			e.printStackTrace();
			QTSession.close ();
		}
	}
 
	public PlayMovie (String title) {
		super (title);
		myQTCanvas = new QTCanvas();
		
		new FileMenu (this);
		 			
		add(myQTCanvas);			
		addWindowListener(new WindowAdapter () {
			public void windowClosing (WindowEvent e) {
				goAway();
			}
			
			public void windowClosed (WindowEvent e) { 
				System.exit(0);
			}
		});
	}
 
	private QTDrawable myPlayer;
	private Movie m;
	private QTCanvas myQTCanvas;	
	
	// This will resize the window to the size of the new movie
	public void createNewMovieFromURL (String theURL) {
		try {
			// create the DataRef that contains the information about where the movie is
			DataRef urlMovie = new DataRef(theURL);
			
			// create the movie 
			m = Movie.fromDataRef (urlMovie,StdQTConstants.newMovieActive);
			
			// This shows the steps to use the three different Objects to present a Movie
				// QTPlayer -> presents the MovieController allowing the user to interact with the movie and control its playback/presentation
				// MoviePlayer -> presents the Movie directly to the screen - application could provide its own controls
				// MoviePresenter -> puts the Movie into an offscreen buffer, the buffer is then drawn to the screen - application could provide its own controls
			if (true) { // QTPlayer
				MovieController mc = new MovieController (m);			
				mc.setKeysEnabled (true);
				myPlayer = new QTPlayer (mc);
			} else if (false) {	// make a MoviePlayer version
				myPlayer = new MoviePlayer (m);
			} else if (false) {	// make a MoviePresenter out of this
				myPlayer = new MoviePresenter (m);
			}
			
			myQTCanvas.setClient (myPlayer, true);
			
			// this will set the size of the enclosing frame to the size of the incoming movie
			pack();
		
			//no user control over MoviePlayer or MoviePresenter so set rate
			if (false)
				m.setRate(1);
			
		} catch (QTException err) {
			err.printStackTrace();
		}
	}
	
	public QTDrawable getPlayer () { return myPlayer; }
	
	public QTCanvas getCanvas () { return myQTCanvas; }
	
	public Movie getMovie () throws QTException {
		return m;
	}
	
	public static void goAway () {
		QTSession.close();
		System.exit(0);	
	}	
 
	void stopPlayer () {
		try {
			if (m != null)
				m.setRate(0);
		} catch (QTException err) {
			err.printStackTrace();
		}
	}
}


And the error that I get is:

C:\jdk1.2.2\bin>java C:\PlayMovie.class
Exception in thread "main" java.lang.NoClassDefFoundError: PlayMovie/class


Thanks for your reply.

Budi


Thomas SMETS

Posts: 307
Nickname: tsmets
Registered: Apr, 2002

Re: Error in Running the class Posted: Apr 29, 2002 12:20 AM
Reply to this message Reply
Well the VM doesn't find it in your classpath !

That should be it !

Thomas,

Flat View: This topic has 1 reply on 1 page
Topic: Retrieving users accounts by Java Previous Topic   Next Topic Topic: How is this executed?

Sponsored Links



Google
  Web Artima.com   

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