Import javax.media?

i have been trying to play a video from a application and i get a bunch of compile errors one is "package javax.media does not exist" because of this im getting 14 other errors, can anyone help me? i just downloaded and installed Java SDK 1.4.2 and i have jdk1.5.0_05 and jre1.5.0_05. so i should be up to date

Well changing the classpath to the correct one still didn't work.... but i still found the solution.
The Developer Environment that i use is JCreator and it seems it ignores the classpath and has its own settings for the class path... changing this also didn't work.
What worked was copying the Jar files from the JMF2.1.1e installed location into the path of the original classpath

Similar Messages

  • Import javax.media.* is not working

    Hi,
    I'm new to java and i was trying to create a media player using the javax.media package from the JMF. I installed it using the windows setup and it seemed to install correctly. Testing it with the java.sun.com applet tester worked. The media player is also working...
    The only problem is that when i import javax.medis.* it gives me a compiler error:
    package javax.media does not exist
    my code is as follows:
    import java.applet.*;
    import java.awt.*;
    import java.net.*;
    import javax.media.*;
    public class PlayerApplet extends Applet {
         Player player = null;
    public void init() {
         setLayout( new BorderLayout() );
         String mediaFile = getParameter( "FILE" );
         try{
              URL mediaURL = new URL( getDocumentBase(), mediaFile );
              player = Manager.createRealizedPlayer( mediaURL );
              if (player.getVisualComponent() != null)
              add("Center", player.getVisualComponent());
              if (player.getControlPanelComponent() != null)
              add("South", player.getControlPanelComponent());
         catch (Exception e){
              System.err.println( "Got exception " + e );
    public void start() {
         player.start();
    public void stop() {
         player.stop();
         player.deallocate();
    public void destroy() {
         player.close();
    } Could someone please help me out here... i've tried all the few probable solutions... but to no avail...

    Well changing the classpath to the correct one still didn't work.... but i still found the solution.
    The Developer Environment that i use is JCreator and it seems it ignores the classpath and has its own settings for the class path... changing this also didn't work.
    What worked was copying the Jar files from the JMF2.1.1e installed location into the path of the original classpath

  • In compileng time this class not found import javax.media.jai.JA

    Hi,
    I�m download
    jai_imageio-1_0_01-lib-windows-i586
    jai_imageio-1_0_01-lib-windows-i586-jdk
    jai_imageio-1_0_01-lib-windows-i586-jre
    jdk-1_5_0_02-windows-i586-p
    in compel time
    import com.sun.media.jai.codec.*;
    import javax.media.jai.JAI;
    The complier gave me error class not found
    How can i configured my system
    I have Windows XP
    [email protected]

    try compiling like this:
    java -cp "." myTest
    This is not compiling, here you execute the already
    compiled myTest.java file (or it should be already
    compiled). To compile you may want to use javac or any
    other available compiler.Oops, sorry, I didn't mean compiling.
    If you were able to compile ok, you can try running the program by using:
    java -cp "." myTest
    This usually will solve the problem when your program comples fine but can't find the class when you try to run it. It's almost like the compiler assumes to look in the current directory but the VM (java.exe) doesn't make this assumption.

  • How to import javax.media.*

    i am doing project on audio ,video transmission over the LAN.
    after installing JMF1.2.1, when i run the program i am getting the error
    "D:\raghu\amp\audiolabreports\ampcom\AmpCom.java:3: package javax.media does not exist
    import javax.media.*;
    ^
    1 error"
    please help me out
    -raghnath.g

    Hi,
    You need to place jmf.jar in your classpath.
    -Amol

  • Import javax.media.* (package missin )

    i am using netbeans 5.0, when i compile my code it give me error of package media missing..
    guyz help me out .
    thank u

    http://java.sun.com/products/java-media/jmf/2.1.1/download.html

  • Re: import  javax.media.*  question

    Thank you very much.
    I just downloaded the JMF package from java.sun.com and there is no compilation error.
    Time to debug the program.
    Thanks again.

    Well changing the classpath to the correct one still didn't work.... but i still found the solution.
    The Developer Environment that i use is JCreator and it seems it ignores the classpath and has its own settings for the class path... changing this also didn't work.
    What worked was copying the Jar files from the JMF2.1.1e installed location into the path of the original classpath

  • Javax.media,j3d import problem

    Hi,
    I had one old project and have tried to run it today.
    I have downloaded jdse 1.5 and I have tried to compile with eclipse 3.1 but I can't import these classes, the errors are :
    Severity     Description     Resource     In Folder     Location     Creation Time
    2     The import javax.media cannot be resolved     Demoirb2000nonrealtime.java     RTEnvironment/Demo     line 15     8 de diciembre de 2005 10:49:38
    2     The import javax.vecmath cannot be resolved     Demoirb2000nonrealtime.java     RTEnvironment/Demo     line 16     8 de diciembre de 2005 10:49:38
    2     The import com.sun.j3d cannot be resolved     Receiver.java     RTEnvironment/Demo     line 4     8 de diciembre de 2005 10:39:33
    what can I do?

    try a search on google for javax.media and the others import I'm not sure but I think they are not standard java.

  • Javax.media.NoPlayerException: Cannot find a Player

    Hi all,
    I've installed JMF,
    and tried the sample 'SimplePlayerApplet.java' from Sun:
    http://java.sun.com/products/java-media/jmf/2.1.1/samples/
    (see the code below)
    However, everytime I run the applet,
    I get the message:
    "javax.media.NoPlayerException: Cannot find a Player"
    Can anybody help?
    -------code from sun website-----------------
    * @(#)SimplePlayerApplet.java     1.2 01/03/13
    * Copyright (c) 1996-2001 Sun Microsystems, Inc. All Rights Reserved.
    * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
    * modify and redistribute this software in source and binary code form,
    * provided that i) this copyright notice and license appear on all copies of
    * the software; and ii) Licensee does not utilize the software in a manner
    * which is disparaging to Sun.
    * This software is provided "AS IS," without a warranty of any kind. ALL
    * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
    * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
    * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
    * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
    * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
    * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
    * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
    * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
    * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
    * POSSIBILITY OF SUCH DAMAGES.
    * This software is not designed or intended for use in on-line control of
    * aircraft, air traffic, aircraft navigation or aircraft communications; or in
    * the design, construction, operation or maintenance of any nuclear
    * facility. Licensee represents and warrants that it will not use or
    * redistribute the Software for such purposes.
    import java.applet.Applet;
    import java.awt.*;
    import java.awt.event.*;
    import java.lang.String;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.io.IOException;
    import java.util.Properties;
    import javax.media.*;
    //import com.sun.media.util.JMFSecurity;
    * This is a Java Applet that demonstrates how to create a simple
    * media player with a media event listener. It will play the
    * media clip right away and continuously loop.
    * <!-- Sample HTML
    * <applet code=SimplePlayerApplet width=320 height=300>
    * <param name=file value="sun.avi">
    * </applet>
    * -->
    public class SimplePlayerApplet extends Applet implements ControllerListener {
    // media Player
    Player player = null;
    // component in which video is playing
    Component visualComponent = null;
    // controls gain, position, start, stop
    Component controlComponent = null;
    // displays progress during download
    Component progressBar = null;
    boolean firstTime = true;
    long CachingSize = 0L;
    Panel panel = null;
    int controlPanelHeight = 0;
    int videoWidth = 0;
    int videoHeight = 0;
    * Read the applet file parameter and create the media
    * player.
    public void init() {
    //$ System.out.println("Applet.init() is called");
    setLayout(null);
    setBackground(Color.white);
    panel = new Panel();
    panel.setLayout( null );
    add(panel);
    panel.setBounds(0, 0, 320, 240);
    // input file name from html param
    String mediaFile = null;
    // URL for our media file
    MediaLocator mrl = null;
    URL url = null;
    // Get the media filename info.
    // The applet tag should contain the path to the
    // source media file, relative to the html page.
    if ((mediaFile = getParameter("FILE")) == null)
    Fatal("Invalid media file parameter");
    try {
    url = new URL(getDocumentBase(), mediaFile);
    mediaFile = url.toExternalForm();
    } catch (MalformedURLException mue) {
    try {
    // Create a media locator from the file name
    if ((mrl = new MediaLocator(mediaFile)) == null)
    Fatal("Can't build URL for " + mediaFile);
    try {
    JMFSecurity.enablePrivilege.invoke(JMFSecurity.privilegeManager,
    JMFSecurity.writePropArgs);
    JMFSecurity.enablePrivilege.invoke(JMFSecurity.privilegeManager,
    JMFSecurity.readPropArgs);
    JMFSecurity.enablePrivilege.invoke(JMFSecurity.privilegeManager,
    JMFSecurity.connectArgs);
    } catch (Exception e) {}
    // Create an instance of a player for this media
    try {
    player = Manager.createPlayer(mrl);
    } catch (NoPlayerException e) {
    System.out.println(e);
    Fatal("Could not create player for " + mrl);
    // Add ourselves as a listener for a player's events
    player.addControllerListener(this);
    } catch (MalformedURLException e) {
    Fatal("Invalid media file URL!");
    } catch (IOException e) {
    Fatal("IO exception creating player for " + mrl);
    // This applet assumes that its start() calls
    // player.start(). This causes the player to become
    // realized. Once realized, the applet will get
    // the visual and control panel components and add
    // them to the Applet. These components are not added
    // during init() because they are long operations that
    // would make us appear unresposive to the user.
    * Start media file playback. This function is called the
    * first time that the Applet runs and every
    * time the user re-enters the page.
    public void start() {
    //$ System.out.println("Applet.start() is called");
    // Call start() to prefetch and start the player.
    if (player != null)
    player.start();
    * Stop media file playback and release resource before
    * leaving the page.
    public void stop() {
    //$ System.out.println("Applet.stop() is called");
    if (player != null) {
    player.stop();
    player.deallocate();
    public void destroy() {
    //$ System.out.println("Applet.destroy() is called");
    player.close();
    * This controllerUpdate function must be defined in order to
    * implement a ControllerListener interface. This
    * function will be called whenever there is a media event
    public synchronized void controllerUpdate(ControllerEvent event) {
    // If we're getting messages from a dead player,
    // just leave
    if (player == null)
    return;
    // When the player is Realized, get the visual
    // and control components and add them to the Applet
    if (event instanceof RealizeCompleteEvent) {
    if (progressBar != null) {
    panel.remove(progressBar);
    progressBar = null;
    int width = 320;
    int height = 0;
    if (controlComponent == null)
    if (( controlComponent =
    player.getControlPanelComponent()) != null) {
    controlPanelHeight = controlComponent.getPreferredSize().height;
    panel.add(controlComponent);
    height += controlPanelHeight;
    if (visualComponent == null)
    if (( visualComponent =
    player.getVisualComponent())!= null) {
    panel.add(visualComponent);
    Dimension videoSize = visualComponent.getPreferredSize();
    videoWidth = videoSize.width;
    videoHeight = videoSize.height;
    width = videoWidth;
    height += videoHeight;
    visualComponent.setBounds(0, 0, videoWidth, videoHeight);
    panel.setBounds(0, 0, width, height);
    if (controlComponent != null) {
    controlComponent.setBounds(0, videoHeight,
    width, controlPanelHeight);
    controlComponent.invalidate();
    } else if (event instanceof CachingControlEvent) {
    if (player.getState() > Controller.Realizing)
    return;
    // Put a progress bar up when downloading starts,
    // take it down when downloading ends.
    CachingControlEvent e = (CachingControlEvent) event;
    CachingControl cc = e.getCachingControl();
    // Add the bar if not already there ...
    if (progressBar == null) {
    if ((progressBar = cc.getControlComponent()) != null) {
    panel.add(progressBar);
    panel.setSize(progressBar.getPreferredSize());
    validate();
    } else if (event instanceof EndOfMediaEvent) {
    // We've reached the end of the media; rewind and
    // start over
    player.setMediaTime(new Time(0));
    player.start();
    } else if (event instanceof ControllerErrorEvent) {
    // Tell TypicalPlayerApplet.start() to call it a day
    player = null;
    Fatal(((ControllerErrorEvent)event).getMessage());
    } else if (event instanceof ControllerClosedEvent) {
    panel.removeAll();
    void Fatal (String s) {
    // Applications will make various choices about what
    // to do here. We print a message
    System.err.println("FATAL ERROR: " + s);
    throw new Error(s); // Invoke the uncaught exception
    // handler System.exit() is another
    // choice.
    }

    First and most obvious question is, what are you trying to have the applet view? The NoPlayerException generally means that JMF couldn't figure out how to display what you're telling it to display, be that an unknown codec, or unknown media type.

  • Javax.media Where download it?

    Hi all.
    I've downloaded and create the jmf.jar from jmf-2_1_1e-scsl-bin.
    Now I try to compile this:
    [cut]
    import com.sun.image.codec.jpeg.JPEGCodec;
    import com.sun.image.codec.jpeg.JPEGEncodeParam;
    import com.sun.image.codec.jpeg.JPEGImageEncoder;
    import javax.media.*;
    import javax.media.control.FrameGrabbingControl;
    import javax.media.format.VideoFormat;
    import javax.media.util.BufferToImage;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.image.BufferedImage;
    import java.io.FileOutputStream;
    [cut]
    but I've this errors:
    [cut]
    Scan.java [15:1] package javax.media does not exist
    import javax.media.*;
    ^
    Scan.java [16:1] package javax.media.control does not exist
    import javax.media.control.FrameGrabbingControl;
    ^
    Scan.java [17:1] package javax.media.format does not exist
    import javax.media.format.VideoFormat;
    ^
    Scan.java [18:1] package javax.media.util does not exist
    import javax.media.util.BufferToImage;
    ^
    4 errors
    Errors compiling Scan.
    [cut]
    So, where I've to download the javax.media pakage?
    thank you.
    jmaxosft
    [cut]

    Try:
    http://java.sun.com/products/java-media/jmf/2.1.1/download.html
    Yous should choose cross-platform java and in zip file you have
    in directory :src\share\ packet source for javax, copy it to your
    project directory and that's it...
    I hope it helps...

  • Javax.media.CannotRealizeException

    package mediaplayer;
    import javax.swing.*;
    import java.awt.*;
    import javax.media.*;
    import java.net.*;
    public class PlayerFrame extends JFrame
        public PlayerFrame() throws Exception
            setSize(500, 400);
            Manager.setHint( Manager.LIGHTWEIGHT_RENDERER, true);
            Player p = Manager.createRealizedPlayer(new URL("http://rds.yahoo.com/_ylt=A0SO8Z0s8ntIvv0AdxX8w8QF;_ylu=X3oDMTA4NDgyNWN0BHNlYwNwcm9m/SIG=12a3nctk9/EXP=1216168876/**http%3a//www.doupe.cz/vaulty/finalfantasy/movies/cnn.avi"));
            Component video = p.getVisualComponent();
            Component panel = p.getControlPanelComponent();
            if(video != null)
                add(video);
            if(panel != null)
                add(panel, BorderLayout.SOUTH);
            p.start();
    Unable to handle format: DX50, 640x320, FrameRate=29.9, Length=1228800 0 extra bytes
      Unable to handle format: mpeglayer3, 24000.0 Hz, 0-bit, Stereo, Unsigned, 8000.0 frame rate, FrameSize=8 bits
    Failed to realize: com.sun.media.PlaybackEngine@105bd58
    Error: Unable to realize com.sun.media.PlaybackEngine@105bd58
    Exception in thread "main" javax.media.CannotRealizeException
            at javax.media.Manager.blockingCall(Manager.java:2005)
            at javax.media.Manager.createRealizedPlayer(Manager.java:528)
            at mediaplayer.PlayerFrame.<init>(PlayerFrame.java:14)
            at mediaplayer.Main.main(Main.java:9)

    The file you are trying to play is in an unsupported format.
    Supported formats:
    http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/formats.html

  • Javax.media.jai not in jmf.jar

    I’ve download JMF 2.1.1e from
    http://java.sun.com/javase/technologies/desktop/media/jmf/2.1.1/download.html
    and installed it. However it does not seem to contain the javax.media.jai or com.sun.media.jai packages as per the documentation :-
    http://java.sun.com/products/java-media/jai/forDevelopers/jai-apidocs/index.html
    I checked the contains of the jmf.tar and and the other jars that came with the download
    eg the following can not be found
    import javax.media.jai.widget.ScrollingImagePanel;
    import javax.media.jai.NullOpImage;
    import javax.media.jai.OpImage;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.FileSeekableStream;
    import com.sun.media.jai.codec.TIFFDecodeParam;
    import com.sun.media.jai.codec.ImageDecoder;
    import com.sun.media.jai.codec.ImageCodec;
    So have I done something wrong, is this code no long in the jmf.jar, or is the documentation wrong ?

    Thanks, that got me the jai_imageio.jar , however this jar does not contain the any of the following packages
    import javax.media.jai.widget.ScrollingImagePanel;
    import javax.media.jai.NullOpImage;
    import javax.media.jai.OpImage;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.FileSeekableStream;
    import com.sun.media.jai.codec.TIFFDecodeParam;
    import com.sun.media.jai.codec.ImageDecoder;
    import com.sun.media.jai.codec.ImageCodec;
    are they in another jar that I have not included, or do I need to get them from somewhere else?

  • Import javax packages

    i have installed JMF yet my programs show an error saying " cant import javax.comm" and cant import "javax.media.*". i would like to know how and where should packages be extracted so that the java program can access them.
    thanx in advance.
    regards.

    javax.comm is a pain in the rear to install - the instructions haven't been updated since 1997, and windows 2k etc works differently from nt/95! You have to put all the files they mention in the appropriate places (they specify) in c:\program files\java\ etc rather than in c:\j2sdk1.4.1\... by the time I had finally figured this out (I'm not the fastest on the draw!) the damn files were everywhere on my hard-drive! Maybe something similar for media? Hope this helps, have a nice day :)

  • Javax.media, installing

    Hi, I am trying to use:
    import javax.media.jai.PlanarImage;
    import javax.media.jai.Histogram;
    But I keep getting an error, how do i install them? I am assuming i have to download a new developers pack, and how do I install it under eclipse?
    Many thanks, Ron

    I have the same problem, can you help to solve it?
    I can't make work JMF in my linux box:
    I have added these lines to my .bashrc script:
    export JMFHOME=/usr/local/lib/JMF-2.1.1e
    export CLASSPATH=$JMFHOME/lib/jmf.jar
    export LD_LIBRARY_PATH=$JMFHOME/lib
    Additionally I have make ln -s /usr/local/lib/JMF-2.1.1/lib/jmf.jar in
    my /usr/local/lib/j2re1.4.2_01/lib/ext/ directory.
    And
    http://java.sun.com/products/java-media/jmf/2.1.1/jmfdiagnostics.html
    always say me:
    "JMF Version... 2.1.1e
    All Java Build
    Native Libraries Not Found"
    What are "Native Libraries"?
    Can you help me please?

  • Package javax.media doesnot exits

    Hi,
    I have installed JMF,but am still facing the error "package javax.media doesnot exits"
    when i tried to import javax.media.*

    You need to import JMF's library JAR files

  • Use of javax.media.jai

    Hi all,
    I wanted to use some classes of javax.media.jai but , I get this error which says
    cannot resolve javax.media, I am using eclipse to write my code. Please let me know what I need to do.
    Thank you.

    Two things to check.
    If your trying to actually use the JAI from javax.media.jai you need to
    have the following import.
    import javax.media.jai.JAI;
    Also in eclipse you need to make sure that you have the package included in the project, and that your Class Paths are correct. If your class paths aren't correct then even if you have the package in the project you'll get errors.
    Hope that helps.

Maybe you are looking for

  • Sony DCR-HC42 and Final Cut Pro??

    Can anyone verify that the Sony DCR HC42 digital video camera works with an G4 12" iBook and Final Cut Pro 5?? I want to buy this camera but want to make sure I can edit the footage with FCP. Any help would be appreciated.

  • 10.7 share to 10.6?

    Hi, i'm trying to share a calendar I've created in iCal in lion with a friend running snow leopard, but he is being asked to upgrade to iCloud. Does he have to do this? Thanks, Andrew.

  • Regarding Material creation

    Hi friends........ I have requirement to create Material through workflow....... menas we need to pass different views to different person..in his business workplace.... Thanks in Advance....... Regards, Charan

  • Problem with Anchor tag in windows Chineese XP OS

    Hi , In my application I use an anchor tag to point to save item once page is submitted and reloaded. The URL with anchor is generated by the servelet dynmically URL will be something like this loaclhost:8080/myapp/CartonPlannerLoad?shipCode=996#2 Th

  • How to make a loop of redirecting?

    I'm writing a servlet that can redirect through sites after an amount of time. For example: yahoo.com then google.com then dell.com... But my knowledge is limited to using setHeader("Refresh", "Time; URL") so it can only redirect for 1 time. Can any