Skip to content

Commit 81a68b6

Browse files
committed
add {java,python}_home()
1 parent abfe336 commit 81a68b6

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

+stdlib/java_home.m

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
%% JAVA_HOME get the JAVA_HOME environment variable
2+
3+
function h = java_home()
4+
5+
try
6+
h = javaMethod("getProperty", "java.lang.System", "java.home");
7+
catch
8+
h = '';
9+
end
10+
11+
end
12+
13+
%!assert(!isempty(java_home()))

+stdlib/python_home.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
%% PYTHON_HOME tell the home directory of Python install
2+
3+
function h = python_home()
4+
5+
try
6+
pe = pyenv();
7+
h = pe.Home;
8+
catch
9+
h = '';
10+
end
11+
12+
end

0 commit comments

Comments
 (0)