Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Local Rhino Debugging
Local Rhino Debugging [message #665682] Fri, 15 April 2011 13:34
Syamkumar Cheedela is currently offline Syamkumar CheedelaFriend
Messages: 7
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: Sat Apr 20 04:04:06 GMT 2024

Powered by FUDForum. Page generated in 0.03001 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top