Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default Instance of GNUPlot object of the package JavaPlot

    Hi friends, im troubled with a ClassNotFoundException for the object of the class GNUPlot. Everything is right with the imported library and classpath of the package, however i still get this (Code and Results) :

    package guiplot;

    import java.math.*;
    import java.io.*;
    import com.panayotis.gnuplot.*;
    import com.panayotis.gnuplot.dataset.*;
    import java.util.logging.Level;
    import java.util.logging.Logger;

    /**
    *
    * @author penalva
    */
    public class Main {

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
    // args.length is equivalent to argc in C

    GNUPlot plotter = new GNUPlot();

    if (args.length == 1)
    {
    try
    {
    // Open the file that is the first
    // command line parameter
    File fstream = new
    File(args[0]);

    // Convert our input stream to a
    // DataInputStream
    //DataInputStream in = new DataInputStream(fstream);

    FileDataSet dataset = new FileDataSet(fstream);

    try {

    plotter.setGNUPlotPath("/usr/bin/gnuplot");

    }
    catch (IOException ex) {

    Logger.getLogger(Main.class.getName()).log(Level.S EVERE, null, ex);

    }



    // Continue to read lines while
    // there are still some left to read
    /*while (in.available() !=0)
    {
    // Print file line to screen


    double a = Double.parseDouble(in.readLine());
    double b = Double.parseDouble(in.readLine());
    double c = Math.log(a)-Math.log(b);
    System.out.println (a+" "+b+" "+c);

    }*/

    }
    catch (Exception e)
    {
    System.err.println("File input error");
    }

    }
    else
    System.out.println("Invalid parameters");



    }


    ****Results******

    penalva@PenalvaMovel:~$ java -jar '/home/penalva/NetBeansProjects/guiplot/dist/guiplot.jar' '/home/penalva/Desktop/Ibovespa.csv'

    Exception in thread "main" java.lang.NoClassDefFoundError: com/panayotis/gnuplot/GNUPlot
    at guiplot.Main.main(Main.java:27)

    Caused by: java.lang.ClassNotFoundException: com.panayotis.gnuplot.GNUPlot
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 19)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 64)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:332)
    ... 1 more

    *****END OF THE RESULTS*********

    I dont have any idea... to me the package seems to be wreck, but is that possible ? just downloaded from the mean webpage.

    I enjoy your help! thks!

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,165
    Rep Power
    20

    Default

    Does your manifest list the jar file containing GNUPlot?
    And in the correct place?

  3. #3
    Join Date
    Mar 2010
    Posts
    5
    Rep Power
    0

    Default

    Dear friend, very well thought, it's working, will never forget such proceeding again. Thks ! :D

Similar Threads

  1. difference between instance and object
    By JavaJunkie in forum New To Java
    Replies: 50
    Last Post: 05-14-2013, 12:00 AM
  2. serializing an object to the same source package
    By shyameni in forum New To Java
    Replies: 10
    Last Post: 11-11-2009, 07:43 PM
  3. [SOLVED] printing address of current instance of object?
    By emceenugget in forum New To Java
    Replies: 1
    Last Post: 02-09-2009, 10:36 PM
  4. [SOLVED] Non-synchronized instance method of an Object
    By piyu.sha in forum Threads and Synchronization
    Replies: 2
    Last Post: 10-06-2008, 07:35 AM
  5. JavaPlot 0.2.0
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 03-12-2008, 01:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •