octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #60058] Feature request: function javaversion(


From: Ernst Reissner
Subject: [Octave-bug-tracker] [bug #60058] Feature request: function javaversion()
Date: Sun, 28 Feb 2021 19:12:46 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36

Follow-up Comment #18, bug #60058 (project octave):

@philip: 
you discuss many different issues in one post. 
First, yes I hate it also that matlab convolutes all into one version string.

version('-java') as defined by matlab, 
is by no means just the version, but comprises also vendor information. 
Ugly. But no choice, octave is a clone and cannot do better. 

On the other hand, maybe, it is acceptable to add another parameter, so like 

v=version('-java','struct') 

delivering all needed information 
in a struct so that the user can fetch what (s)he wants. 
E.g. v.java_version. 

A problem is also.. what is version?? 
If i have a look at my result, i have the impression, 
what is returned by octave and also by matlab 
is the property java.runtime.version. 

Please have a look at 
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/System.html#getProperties()
There are also older docs for older java releases. 
But java.runtime.version is not among the mandatory properites. 
This means, a jvm is not required to implement it. 

What is supported as mandatory is e.g. java.version 
and starting with java 11 this is the same as Runtime.version() 
which is very strictly specified. 
It comprises at least of 3 numbers (trailing 0 not displayed) 
separated by '.'. This is going to remain stable. 
Of course, java.runtime.version is not stable. 

There are further kinds of mandatory versions as you can see from the property
list and there are more which are not mandatory. 
I think the runtime version is good for bugfixing 
because then you know more where it comes from. 
For me as a package provider, java.version or Runtime.version() 
(defined since java 9) would be fine. 
Advantage: this is clearly specified and it is the same as the property
java.version. 
I would like to see it as part of return of 

version('-java','struct') 

i suggested above. 

Finally let me point out that java.version is a property 
which can be changed. 
System.setProperties(null) triggers re-initialization. 
But i think clearer is to use Runtime.version(). 

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?60058>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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