Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Local Rhino Debugging
Local Rhino Debugging [message #665682] Fri, 15 April 2011 09:34
Syam Missing name is currently offline Syam Missing name
Messages: 6
Registered: April 2011
Junior Member
I want to debug the below js file using local rhino debugger.

math.js
var sb = new Packages.MathUtility();

// Add the 2 numbers
var a = sb.add(2, 3);
print(a);

//Subtract the 2 numbers
var s = sb.subtract(2, 3);
print(s);

//Multiply the 2 numbers
var m = sb.multiply(2, 3);
print(m);

//Divide the 2 numbers
var d = sb.divide(6, 3);
print(d);


MathUtility.java

public class MathUtility {
	
	public MathUtility() {
		
	}
	
	public int add(int a, int b) {
		return (a+b);
	}
	
	public int subtract(int a, int b) {
		return (a-b);
	}
	
	public int multiply(int a, int b) {
		return (a*b);
	}
	
	public int divide(int a, int b) {
		return (a/b);
	}
}


when i try to debug this through eclipse local rhino debugger it is thowing following error.

js: "C:\hiddenpath\math.js", line 1: uncaught JavaScript runtime exception: TypeError: [JavaPackage MathUtility] is not a function, it is object.
at C:\hiddenpath\math.js:1


Can any one please help me how will add any files to java script debugger classpath?
Previous Topic:Extending Web page Editor Palette
Next Topic:unable to run JSF application
Goto Forum:
  


Current Time: Thu Jul 24 19:11:44 EDT 2014

Powered by FUDForum. Page generated in 0.01620 seconds