Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9231755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:08:55+00:00 2026-06-18T06:08:55+00:00

I am trying to use the gv_java – graph manipulation using java with Graphviz.

  • 0

I am trying to use the gv_java – graph manipulation using java with Graphviz.
I downloaded the java package which contains the SWIG Type files in java.Installed graphviz as required.

For a cleaner solution I tried using the JNI provided by graphviz and Here is my test code.

public class TestGraphvizLibrary {

    public final static native long graph__SWIG_0(String jarg1);
    public final static native long digraph(String jarg1);
    public final static native long strictgraph(String jarg1);
    public final static native long strictdigraph(String jarg1);
    public final static native long readstring(String jarg1);
    public final static native long read__SWIG_0(String jarg1);
    public final static native long read__SWIG_1(long jarg1);
    public final static native long graph__SWIG_1(long jarg1, String jarg2);
    public final static native long node(long jarg1, String jarg2);
    public final static native long edge__SWIG_0(long jarg1, long jarg2);
    public final static native long edge__SWIG_1(long jarg1, String jarg2);
    public final static native long edge__SWIG_2(String jarg1, long jarg2);
    public final static native long edge__SWIG_3(long jarg1, String jarg2, String jarg3);
    public final static native String setv__SWIG_0(long jarg1, String jarg2, String jarg3);
    public final static native String setv__SWIG_1(long jarg1, String jarg2, String jarg3);
    public final static native String setv__SWIG_2(long jarg1, String jarg2, String jarg3);
    public final static native String setv__SWIG_3(long jarg1, long jarg2, String jarg3);
    public final static native String setv__SWIG_4(long jarg1, long jarg2, String jarg3);
    public final static native String setv__SWIG_5(long jarg1, long jarg2, String jarg3);
    public final static native String getv__SWIG_0(long jarg1, String jarg2);
    public final static native String getv__SWIG_1(long jarg1, String jarg2);
    public final static native String getv__SWIG_2(long jarg1, String jarg2);
    public final static native String getv__SWIG_3(long jarg1, long jarg2);
    public final static native String getv__SWIG_4(long jarg1, long jarg2);
    public final static native String getv__SWIG_5(long jarg1, long jarg2);
    public final static native String nameof__SWIG_0(long jarg1);
    public final static native String nameof__SWIG_1(long jarg1);
    public final static native String nameof__SWIG_2(long jarg1);
    public final static native long findsubg(long jarg1, String jarg2);
    public final static native long findnode(long jarg1, String jarg2);
    public final static native long findedge(long jarg1, long jarg2);
    public final static native long findattr__SWIG_0(long jarg1, String jarg2);
    public final static native long findattr__SWIG_1(long jarg1, String jarg2);
    public final static native long findattr__SWIG_2(long jarg1, String jarg2);
    public final static native long headof(long jarg1);
    public final static native long tailof(long jarg1);
    public final static native long graphof__SWIG_0(long jarg1);
    public final static native long graphof__SWIG_1(long jarg1);
    public final static native long graphof__SWIG_2(long jarg1);
    public final static native long rootof(long jarg1);
    public final static native long protonode(long jarg1);
    public final static native long protoedge(long jarg1);
    public final static native boolean ok__SWIG_0(long jarg1);
    public final static native boolean ok__SWIG_1(long jarg1);
    public final static native boolean ok__SWIG_2(long jarg1);
    public final static native boolean ok__SWIG_3(long jarg1);
    public final static native long firstsubg(long jarg1);
    public final static native long nextsubg(long jarg1, long jarg2);
    public final static native long firstsupg(long jarg1);
    public final static native long nextsupg(long jarg1, long jarg2);
    public final static native long firstedge__SWIG_0(long jarg1);
    public final static native long nextedge__SWIG_0(long jarg1, long jarg2);
    public final static native long firstout__SWIG_0(long jarg1);
    public final static native long nextout__SWIG_0(long jarg1, long jarg2);
    public final static native long firstedge__SWIG_1(long jarg1);
    public final static native long nextedge__SWIG_1(long jarg1, long jarg2);
    public final static native long firstout__SWIG_1(long jarg1);
    public final static native long nextout__SWIG_1(long jarg1, long jarg2);
    public final static native long firsthead(long jarg1);
    public final static native long nexthead(long jarg1, long jarg2);
    public final static native long firstin__SWIG_0(long jarg1);
    public final static native long nextin__SWIG_0(long jarg1, long jarg2);
    public final static native long firstin__SWIG_1(long jarg1);
    public final static native long nextin__SWIG_1(long jarg1, long jarg2);
    public final static native long firsttail(long jarg1);
    public final static native long nexttail(long jarg1, long jarg2);
    public final static native long firstnode__SWIG_0(long jarg1);
    public final static native long nextnode__SWIG_0(long jarg1, long jarg2);
    public final static native long firstnode__SWIG_1(long jarg1);
    public final static native long nextnode__SWIG_1(long jarg1, long jarg2);
    public final static native long firstattr__SWIG_0(long jarg1);
    public final static native long nextattr__SWIG_0(long jarg1, long jarg2);
    public final static native long firstattr__SWIG_1(long jarg1);
    public final static native long nextattr__SWIG_1(long jarg1, long jarg2);
    public final static native long firstattr__SWIG_2(long jarg1);
    public final static native long nextattr__SWIG_2(long jarg1, long jarg2);
    public final static native boolean rm__SWIG_0(long jarg1);
    public final static native boolean rm__SWIG_1(long jarg1);
    public final static native boolean rm__SWIG_2(long jarg1);
    public final static native boolean layout(long jarg1, String jarg2);
    public final static native boolean render__SWIG_0(long jarg1);
    public final static native boolean render__SWIG_1(long jarg1, String jarg2);
    public final static native boolean render__SWIG_2(long jarg1, String jarg2, long jarg3);
    public final static native boolean render__SWIG_3(long jarg1, String jarg2, String jarg3);
    public final static native boolean renderchannel(long jarg1, String jarg2, String jarg3);
    public final static native void renderresult(long jarg1, String jarg2, String jarg3);
    public final static native String renderdata(long jarg1, String jarg2);
    public final static native boolean write__SWIG_0(long jarg1, String jarg2);
    public final static native boolean write__SWIG_1(long jarg1, long jarg2);


    public static SWIGTYPE_p_Agraph_t graph(String name) {
        long cPtr = gvJNI.graph__SWIG_0(name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t digraphh(String name) {
        long cPtr = digraph(name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t strictgraphh(String name) {
        long cPtr = gvJNI.strictgraph(name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t strictdigraphh(String name) {
        long cPtr = gvJNI.strictdigraph(name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t readstringg(String string) {
        long cPtr = gvJNI.readstring(string);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t read(String filename) {
        long cPtr = gvJNI.read__SWIG_0(filename);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t read(SWIGTYPE_p_FILE f) {
        long cPtr = gvJNI.read__SWIG_1(SWIGTYPE_p_FILE.getCPtr(f));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t graph(SWIGTYPE_p_Agraph_t g, String name) {
        long cPtr = gvJNI.graph__SWIG_1(SWIGTYPE_p_Agraph_t.getCPtr(g), name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t node(SWIGTYPE_p_Agraph_t g, String name) {
        long cPtr = gvJNI.node(SWIGTYPE_p_Agraph_t.getCPtr(g), name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t edge(SWIGTYPE_p_Agnode_t t, SWIGTYPE_p_Agnode_t h) {
        long cPtr = gvJNI.edge__SWIG_0(SWIGTYPE_p_Agnode_t.getCPtr(t), SWIGTYPE_p_Agnode_t.getCPtr(h));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t edge(SWIGTYPE_p_Agnode_t t, String hname) {
        long cPtr = gvJNI.edge__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(t), hname);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t edge(String tname, SWIGTYPE_p_Agnode_t h) {
        long cPtr = gvJNI.edge__SWIG_2(tname, SWIGTYPE_p_Agnode_t.getCPtr(h));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t edge(SWIGTYPE_p_Agraph_t g, String tname, String hname) {
        long cPtr = gvJNI.edge__SWIG_3(SWIGTYPE_p_Agraph_t.getCPtr(g), tname, hname);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static String setv(SWIGTYPE_p_Agraph_t g, String attr, String val) {
        return gvJNI.setv__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g), attr, val);
      }

      public static String setv(SWIGTYPE_p_Agnode_t n, String attr, String val) {
        return gvJNI.setv__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n), attr, val);
      }

      public static String setv(SWIGTYPE_p_Agedge_t e, String attr, String val) {
        return gvJNI.setv__SWIG_2(SWIGTYPE_p_Agedge_t.getCPtr(e), attr, val);
      }

      public static String setv(SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agsym_t a, String val) {
        return gvJNI.setv__SWIG_3(SWIGTYPE_p_Agraph_t.getCPtr(g), SWIGTYPE_p_Agsym_t.getCPtr(a), val);
      }

      public static String setv(SWIGTYPE_p_Agnode_t n, SWIGTYPE_p_Agsym_t a, String val) {
        return gvJNI.setv__SWIG_4(SWIGTYPE_p_Agnode_t.getCPtr(n), SWIGTYPE_p_Agsym_t.getCPtr(a), val);
      }

      public static String setv(SWIGTYPE_p_Agedge_t e, SWIGTYPE_p_Agsym_t a, String val) {
        return gvJNI.setv__SWIG_5(SWIGTYPE_p_Agedge_t.getCPtr(e), SWIGTYPE_p_Agsym_t.getCPtr(a), val);
      }

      public static String getv(SWIGTYPE_p_Agraph_t g, String attr) {
        return gvJNI.getv__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g), attr);
      }

      public static String getv(SWIGTYPE_p_Agnode_t n, String attr) {
        return gvJNI.getv__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n), attr);
      }

      public static String getv(SWIGTYPE_p_Agedge_t e, String attr) {
        return gvJNI.getv__SWIG_2(SWIGTYPE_p_Agedge_t.getCPtr(e), attr);
      }

      public static String getv(SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agsym_t a) {
        return gvJNI.getv__SWIG_3(SWIGTYPE_p_Agraph_t.getCPtr(g), SWIGTYPE_p_Agsym_t.getCPtr(a));
      }

      public static String getv(SWIGTYPE_p_Agnode_t n, SWIGTYPE_p_Agsym_t a) {
        return gvJNI.getv__SWIG_4(SWIGTYPE_p_Agnode_t.getCPtr(n), SWIGTYPE_p_Agsym_t.getCPtr(a));
      }

      public static String getv(SWIGTYPE_p_Agedge_t e, SWIGTYPE_p_Agsym_t a) {
        return gvJNI.getv__SWIG_5(SWIGTYPE_p_Agedge_t.getCPtr(e), SWIGTYPE_p_Agsym_t.getCPtr(a));
      }

      public static String nameof(SWIGTYPE_p_Agraph_t g) {
        return gvJNI.nameof__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g));
      }

      public static String nameof(SWIGTYPE_p_Agnode_t n) {
        return gvJNI.nameof__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n));
      }

      public static String nameof(SWIGTYPE_p_Agsym_t a) {
        return gvJNI.nameof__SWIG_2(SWIGTYPE_p_Agsym_t.getCPtr(a));
      }

      public static SWIGTYPE_p_Agraph_t findsubg(SWIGTYPE_p_Agraph_t g, String name) {
        long cPtr = gvJNI.findsubg(SWIGTYPE_p_Agraph_t.getCPtr(g), name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t findnode(SWIGTYPE_p_Agraph_t g, String name) {
        long cPtr = gvJNI.findnode(SWIGTYPE_p_Agraph_t.getCPtr(g), name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t findedge(SWIGTYPE_p_Agnode_t t, SWIGTYPE_p_Agnode_t h) {
        long cPtr = gvJNI.findedge(SWIGTYPE_p_Agnode_t.getCPtr(t), SWIGTYPE_p_Agnode_t.getCPtr(h));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agsym_t findattr(SWIGTYPE_p_Agraph_t g, String name) {
        long cPtr = gvJNI.findattr__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g), name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agsym_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agsym_t findattr(SWIGTYPE_p_Agnode_t n, String name) {
        long cPtr = gvJNI.findattr__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n), name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agsym_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agsym_t findattr(SWIGTYPE_p_Agedge_t e, String name) {
        long cPtr = gvJNI.findattr__SWIG_2(SWIGTYPE_p_Agedge_t.getCPtr(e), name);
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agsym_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t headof(SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.headof(SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t tailof(SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.tailof(SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t graphof(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.graphof__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t graphof(SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.graphof__SWIG_1(SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t graphof(SWIGTYPE_p_Agnode_t n) {
        long cPtr = gvJNI.graphof__SWIG_2(SWIGTYPE_p_Agnode_t.getCPtr(n));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t rootof(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.rootof(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t protonode(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.protonode(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t protoedge(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.protoedge(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static boolean ok(SWIGTYPE_p_Agraph_t g) {
        return gvJNI.ok__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g));
      }

      public static boolean ok(SWIGTYPE_p_Agnode_t n) {
        return gvJNI.ok__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n));
      }

      public static boolean ok(SWIGTYPE_p_Agedge_t e) {
        return gvJNI.ok__SWIG_2(SWIGTYPE_p_Agedge_t.getCPtr(e));
      }

      public static boolean ok(SWIGTYPE_p_Agsym_t a) {
        return gvJNI.ok__SWIG_3(SWIGTYPE_p_Agsym_t.getCPtr(a));
      }

      public static SWIGTYPE_p_Agraph_t firstsubg(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.firstsubg(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t nextsubg(SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agraph_t sg) {
        long cPtr = gvJNI.nextsubg(SWIGTYPE_p_Agraph_t.getCPtr(g), SWIGTYPE_p_Agraph_t.getCPtr(sg));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t firstsupg(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.firstsupg(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agraph_t nextsupg(SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agraph_t sg) {
        long cPtr = gvJNI.nextsupg(SWIGTYPE_p_Agraph_t.getCPtr(g), SWIGTYPE_p_Agraph_t.getCPtr(sg));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agraph_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t firstedge(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.firstedge__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t nextedge(SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.nextedge__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g), SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t firstout(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.firstout__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t nextout(SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.nextout__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g), SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t firstedge(SWIGTYPE_p_Agnode_t n) {
        long cPtr = gvJNI.firstedge__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t nextedge(SWIGTYPE_p_Agnode_t n, SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.nextedge__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n), SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t firstout(SWIGTYPE_p_Agnode_t n) {
        long cPtr = gvJNI.firstout__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t nextout(SWIGTYPE_p_Agnode_t n, SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.nextout__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n), SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t firsthead(SWIGTYPE_p_Agnode_t n) {
        long cPtr = gvJNI.firsthead(SWIGTYPE_p_Agnode_t.getCPtr(n));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t nexthead(SWIGTYPE_p_Agnode_t n, SWIGTYPE_p_Agnode_t h) {
        long cPtr = gvJNI.nexthead(SWIGTYPE_p_Agnode_t.getCPtr(n), SWIGTYPE_p_Agnode_t.getCPtr(h));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t firstin(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.firstin__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t nextin(SWIGTYPE_p_Agnode_t n, SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.nextin__SWIG_0(SWIGTYPE_p_Agnode_t.getCPtr(n), SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t firstin(SWIGTYPE_p_Agnode_t n) {
        long cPtr = gvJNI.firstin__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agedge_t nextin(SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.nextin__SWIG_1(SWIGTYPE_p_Agraph_t.getCPtr(g), SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agedge_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t firsttail(SWIGTYPE_p_Agnode_t n) {
        long cPtr = gvJNI.firsttail(SWIGTYPE_p_Agnode_t.getCPtr(n));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t nexttail(SWIGTYPE_p_Agnode_t n, SWIGTYPE_p_Agnode_t t) {
        long cPtr = gvJNI.nexttail(SWIGTYPE_p_Agnode_t.getCPtr(n), SWIGTYPE_p_Agnode_t.getCPtr(t));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t firstnode(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.firstnode__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t nextnode(SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agnode_t n) {
        long cPtr = gvJNI.nextnode__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g), SWIGTYPE_p_Agnode_t.getCPtr(n));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t firstnode(SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.firstnode__SWIG_1(SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agnode_t nextnode(SWIGTYPE_p_Agedge_t e, SWIGTYPE_p_Agnode_t n) {
        long cPtr = gvJNI.nextnode__SWIG_1(SWIGTYPE_p_Agedge_t.getCPtr(e), SWIGTYPE_p_Agnode_t.getCPtr(n));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agnode_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agsym_t firstattr(SWIGTYPE_p_Agraph_t g) {
        long cPtr = gvJNI.firstattr__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agsym_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agsym_t nextattr(SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_Agsym_t a) {
        long cPtr = gvJNI.nextattr__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g), SWIGTYPE_p_Agsym_t.getCPtr(a));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agsym_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agsym_t firstattr(SWIGTYPE_p_Agedge_t e) {
        long cPtr = gvJNI.firstattr__SWIG_1(SWIGTYPE_p_Agedge_t.getCPtr(e));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agsym_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agsym_t nextattr(SWIGTYPE_p_Agedge_t e, SWIGTYPE_p_Agsym_t a) {
        long cPtr = gvJNI.nextattr__SWIG_1(SWIGTYPE_p_Agedge_t.getCPtr(e), SWIGTYPE_p_Agsym_t.getCPtr(a));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agsym_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agsym_t firstattr(SWIGTYPE_p_Agnode_t n) {
        long cPtr = gvJNI.firstattr__SWIG_2(SWIGTYPE_p_Agnode_t.getCPtr(n));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agsym_t(cPtr, false);
      }

      public static SWIGTYPE_p_Agsym_t nextattr(SWIGTYPE_p_Agnode_t n, SWIGTYPE_p_Agsym_t a) {
        long cPtr = gvJNI.nextattr__SWIG_2(SWIGTYPE_p_Agnode_t.getCPtr(n), SWIGTYPE_p_Agsym_t.getCPtr(a));
        return (cPtr == 0) ? null : new SWIGTYPE_p_Agsym_t(cPtr, false);
      }

      public static boolean rm(SWIGTYPE_p_Agraph_t g) {
        return gvJNI.rm__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g));
      }

      public static boolean rm(SWIGTYPE_p_Agnode_t n) {
        return gvJNI.rm__SWIG_1(SWIGTYPE_p_Agnode_t.getCPtr(n));
      }

      public static boolean rm(SWIGTYPE_p_Agedge_t e) {
        return gvJNI.rm__SWIG_2(SWIGTYPE_p_Agedge_t.getCPtr(e));
      }

      public static boolean layout(SWIGTYPE_p_Agraph_t g, String engine) {
        return gvJNI.layout(SWIGTYPE_p_Agraph_t.getCPtr(g), engine);
      }

      public static boolean render(SWIGTYPE_p_Agraph_t g) {
        return gvJNI.render__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g));
      }

      public static boolean render(SWIGTYPE_p_Agraph_t g, String format) {
        return gvJNI.render__SWIG_1(SWIGTYPE_p_Agraph_t.getCPtr(g), format);
      }

      public static boolean render(SWIGTYPE_p_Agraph_t g, String format, SWIGTYPE_p_FILE fout) {
        return gvJNI.render__SWIG_2(SWIGTYPE_p_Agraph_t.getCPtr(g), format, SWIGTYPE_p_FILE.getCPtr(fout));
      }

      public static boolean render(SWIGTYPE_p_Agraph_t g, String format, String filename) {
        return gvJNI.render__SWIG_3(SWIGTYPE_p_Agraph_t.getCPtr(g), format, filename);
      }

      public static boolean renderchannel(SWIGTYPE_p_Agraph_t g, String format, String channelname) {
        return gvJNI.renderchannel(SWIGTYPE_p_Agraph_t.getCPtr(g), format, channelname);
      }

      public static void renderresult(SWIGTYPE_p_Agraph_t g, String format, String outdata) {
        gvJNI.renderresult(SWIGTYPE_p_Agraph_t.getCPtr(g), format, outdata);
      }

      public static String renderdata(SWIGTYPE_p_Agraph_t g, String format) {
        return gvJNI.renderdata(SWIGTYPE_p_Agraph_t.getCPtr(g), format);
      }

      public static boolean write(SWIGTYPE_p_Agraph_t g, String filename) {
        return gvJNI.write__SWIG_0(SWIGTYPE_p_Agraph_t.getCPtr(g), filename);
      }

      public static boolean write(SWIGTYPE_p_Agraph_t g, SWIGTYPE_p_FILE f) {
        return gvJNI.write__SWIG_1(SWIGTYPE_p_Agraph_t.getCPtr(g), SWIGTYPE_p_FILE.getCPtr(f));
      }

    /**
     * @param args
     */
    public static void main(String[] args) {
        TestGraphvizLibrary gvt = new TestGraphvizLibrary();
        //create a new graph    
        SWIGTYPE_p_Agraph_t newGraph = TestGraphvizLibrary.graph("hello");
        SWIGTYPE_p_Agnode_t headNode =    TestGraphvizLibrary.node(newGraph, "First Node");
        SWIGTYPE_p_Agnode_t tailNode = TestGraphvizLibrary.node(newGraph, "second Node"); 

        //SWIGTYPE_p_Agedge_t firstEdge = gv.edge(tailNode, headNode);
        boolean file =gv.write(newGraph, "graph");
        System.out.println("file is success "+ file);
    }

    static {
        System.out.println("Loading library...");
        System.load("/usr/lib64/graphviz/java/libgv_java.so");
        System.out.println("Loaded library.");
    }


}

The system is able to load the library,but when I call the native methods I get UnsatisfiedLinkError in the line of method call without any message.

Am I doing anything wrong.I have installed graphviz in the linux machine,the libraries and all the classes are in position.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:08:56+00:00Added an answer on June 18, 2026 at 6:08 am

    I checked the installation and everything is proper so I decided that something is wrong with my java files.

    I read various posts on the naming convention while using JNI methods,since for Graphviz all the java method names are generated by SWIG the next thing I checked was the package structure.

    In my code above I initially had all the GraphViz native methods in my own package name rather than org.graphviz (as provided by them).

    I moved them to the respective packages and it worked like a charm!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying use facebook API to upload photo in my fan page. I downloaded
I am trying use a Java Uploader in a ROR app (for its ease
I'm trying to make use of a java api for google voice (available here:
I was trying use svn to find a checkin using svn log, but it
I'm trying use struts2-jasperreports plugin but getting an error with the type result: Grave:
I am trying use MySql and Entity Framework, using Connector/Net 6.1 with this as
I'm trying use make a div's background transparent using a mixture of CSS3 rgba()
I'm trying use an object which wasn't available until SDK level 5. It seems
I'm trying use double type in openCL, but doesn't work anyway, i want use
I'm trying to use graphviz with python and I get the error: Traceback (most

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.