help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with java in octave


From: Mike Miller
Subject: Re: help with java in octave
Date: Tue, 30 Aug 2016 22:52:18 -0700
User-agent: NeoMutt/ (1.7.0)

On Tue, Aug 30, 2016 at 16:00:28 -0500, Dmitri A. Sergatskov wrote:
> I was given a matlab file (that apparently "just works" in matlab) that
> has lines:
> 
> dateFormat = java.text.SimpleDateFormat('dd-MMM-yyyy HH:mm:ss');
> 
> ...
> 
> cal = java.util.GregorianCalendar(java.util.TimeZone.getTimeZone('GMT'),
> java.util.Locale.US);
> 
> (etc...)
> 
> In octave (bot 4.0.3 and dev) those returns errors:
> 
> error: 'java' undefined near line 1 column 14
> 
> I have never used jave with octave, so perhaps i am missing some basics.
> Java is enabled:
> 
> octave_config_info ("features").JAVA
> ans =  1
> 
> octave> javamem
> 
> Java virtual machine (JVM) memory info:
> Maximum available memory:        5358.5 MiB;
>    (...running garbage collector...)
> OK, current status:
> Total memory in virtual machine: 362.5 MiB;
> Free memory in virtual machine:  360.309 MiB;
> 4 CPUs available.
> 
> Though
> 
> octave> javachk ("jvm")
> ans =
> 
> Also javaclasspath is empty.
> 
> What do I need to do?

Octave does not yet support calling Java classes and functions by name
like this. You would have to rewrite syntax like this

  dateFormat = java.text.SimpleDateFormat('dd-MMM-yyyy HH:mm:ss');

into this

  dateFormat = javaObject ('java.text.SimpleDateFormat', 'dd-MMM-yyyy 
HH:mm:ss');

Or try using a java wrapper class to mock up the syntax as suggested
here:

  https://savannah.gnu.org/bugs/?48428#comment4

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]