jdl
jdl

Reputation: 6323

Octave java invalid call to script

Issue with Octave and java. Not sure if I am connecting java to octave correctly for this.

url = java.net.URL(urlString); %%this works in matlab
error: invalid call to script /home/xxx/octave/java-1.2.9/java.m  

But the following examples works:

octave> s = javaObject ("java.lang.String", "Hello OctaveString")
  s = Hello OctaveString

octave> v = javaObject ("java.util.Vector")
  v =
    <Java object: java.util.Vector>
octave> v.add(12);
octave> v.get(0)
  ans = 12

octave> d = javaObject ("java.lang.Double", 12.34)
  d = 12.340 

I have installed Octave3.8.0 using: http://blogs.bu.edu/mhirsch/2013/12/compiling-octave-3-8/comment-page-1/#comment-12930

This link has been helpful too: http://wiki.octave.org/Java_package

Upvotes: 0

Views: 1409

Answers (1)

Daniel
Daniel

Reputation: 36710

The implicit syntax java.net.URL(urlString) is not possible, at least in the version i tested. You have to create every object via javaObject

url = javaObject('java.net.URL',urlString);

Upvotes: 1

Related Questions