osama-raddad/encog-java

new to java and encog, difficulty getting started, class define error

Closed this issue · 1 comments

What steps will reproduce the problem?
1. trying to compile/run a simple java program
2. get a class not found error
3.

What is the expected output? What do you see instead?
output from the XOR example
instead i see the error


What version of the product are you using? On what operating system?
linux

Please provide any additional information below.

I new to java and encog.
I am trying to compile a simple version of the XOR example
However I am getting a class not found error when I try to run the program

- thank you for your help

---
$ javac -cp ../encog-java-core-2.5.3/lib/encog-core-2.5.3.jar TEST.java
$ java -cp ../encog-java-core-2.5.3/lib/encog-core-2.5.3.jar TEST
Exception in thread "main" java.lang.NoClassDefFoundError: TEST
Caused by: java.lang.ClassNotFoundException: TEST
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
Could not find the main class: TEST. Program will exit.


---
here is the test XOR I am trying to get started with

---
//TEST XOR example

//import classes
import org.encog.engine.network.activation.ActivationSigmoid;
import org.encog.neural.data.NeuralData;
import org.encog.neural.data.NeuralDataPair;
import org.encog.neural.data.NeuralDataSet;
import org.encog.neural.data.basic.BasicNeuralDataSet;
import org.encog.neural.networks.BasicNetwork;
import org.encog.neural.networks.layers.BasicLayer;
import org.encog.neural.networks.training.Train;
import 
org.encog.neural.networks.training.propagation.resilient.ResilientPropagation;
import org.encog.neural.networks.training.strategy.RequiredImprovementStrategy;
import org.encog.util.logging.Logging;
// done importing 

public class TEST {

public static void main(final String args[]) {

//Logging.stopConsoleLogging();

// initialize structure of the net
BasicNetwork network = new BasicNetwork();
//network.addLayer(new BasicLayer(null, true, 2));
//network.addLayer(new BasicLayer(new ActivationSigmoid(),true, 4));
//network.addLayer(new BasicLayer(new ActivationSigmoid(),true, 1));
//network.getStructure().finalizeStructure();
//network.reset();
//
} // public static void main
} // public class 



Original issue reported on code.google.com by vesco.mi...@gmail.com on 13 Jun 2011 at 1:33

I think you need to put your cunrrent directory in as a classpath.  namely ./  
because it is failing to find your TEST class.

Original comment by JeffHeat...@gmail.com on 15 Jul 2011 at 1:14

  • Changed state: Invalid