How to run the examples files thanks you

58 views
Skip to first unread message

javi...@gmail.com

unread,
Sep 12, 2016, 12:31:09 AM9/12/16
to melting-forum
Hello,

Could you tell me how to run the examples files successfully  thanks you

 I want to compile test file MainTestAzobenzene in the pakage of examples

but my computer show message below

MainTestAzobenzene.java:30: error: cannot find symbol
Properties azobenzeneSequences = MainTest.loadSequencesTest("src/examples/test/azobenzeneSequences.txt");
                                ^
  symbol:   variable MainTest
  location: class MainTestAzobenzene
MainTestAzobenzene.java:34: error: cannot find symbol
MainTest.displayResults(azobenzeneSequences, azobenzeneMethods, "dnadna", "Na=1", "0.000002", "-azo");
^
  symbol:   variable MainTest
  location: class MainTestAzobenzene



Nicolas Rodriguez

unread,
Sep 26, 2016, 8:38:08 AM9/26/16
to melting-forum
Hello,

So, not sure how you did try to compile the examples and which operating system you are using but I will try to answer
assuming you tried to compile the file in the command line using a Linux or Mac shell.

You cannot compile the class because there is a CLASSPATH problem. The classpath environment variable does tell java
where to find sources or binaries classes. You have to put in the classpath the folders and jar files that are necessary to run the class.

In the case of the Melting examples, you have to put the 'src' folder that contain the examples package, the melting5 jar and if you
are using the recent source repository, the jar file htsjdk-2.3.0.jar located in the lib folder.

You have to be at the root of the melting files for the following examples command to work:

To compile the example classes:

javac -classpath ./src:executable/melting5.jar:./lib/htsjdk-2.3.0.jar src/examples/MainTest.java src/examples/MainTestAzobenzene.java

To run the class:

java -classpath ./src:executable/melting5.jar examples.MainTestAzobenzene


As a side note, the examples are included in the melting5 jar file, so you could just run:

java -classpath executable/melting5.jar examples.MainTestAzobenzene

to execute the MainTestAzobenzene example, no need to compile it.


Hope this help, don't hesitate to as kif you have any problems.

cheers,
Nico

Nicolas Rodriguez

unread,
Sep 26, 2016, 8:42:04 AM9/26/16
to melting-forum

Forgot to mention that you have also to define the environment variable NN_PATH to be able to properly run the examples:

export NN_PATH=Data

Nico


On Monday, September 26, 2016 at 1:38:08 PM UTC+1, Nicolas Rodriguez wrote:
Hello,

So, not sure how you did try to compile the examples and which operating system you are using but I will try to answer
assuming you tried to compile the file in the command line using a Linux or Mac shell.

You cannot compile the class because there is a CLASSPATH problem. The classpath environment variable does tell java
where to find sources or binaries classes. You have to put in the classpath the folders and jar files that are necessary to run the class.

In the case of the Melting examples, you have to put the 'src' folder that contain the examples package, the melting5 jar and if you
are using the recent source repository, the jar file htsjdk-2.3.0.jar located in the lib folder.

You have to be at the root of the melting files for the following examples command to work:

To compile the example classes:

javac -classpath ./src:executable/melting5.jar:./lib/htsjdk-2.3.0.jar src/examples/MainTest.java src/examples/MainTestAzobenzene.java

To run the class:

java -classpath ./src:executable/melting5.jar examples.MainTestAzobenzene


As a side note, the examples are included in the melting5 jar file, so you could just run:

java -classpath executable/melting5.jar examples.MainTestAzobenzene

to execute the MainTestAzobenzene example, no need to compile it.


Hope this help, don't hesitate to ask if you have any problems.
Reply all
Reply to author
Forward
0 new messages