first jvm then java and last jpl
This commit is contained in:
parent
1deb238d10
commit
994c5d0dfd
@ -4412,7 +4412,7 @@ to_atom(Term, Atom) :-
|
|||||||
|
|
||||||
%------------------------------------------------------------------------------
|
%------------------------------------------------------------------------------
|
||||||
|
|
||||||
/*******************************
|
/******************************
|
||||||
* MESSAGES *
|
* MESSAGES *
|
||||||
*******************************/
|
*******************************/
|
||||||
|
|
||||||
@ -4505,16 +4505,19 @@ location(java_root, _, JRE) :-
|
|||||||
% OS well-known
|
% OS well-known
|
||||||
member(Root, [ '/usr/lib',
|
member(Root, [ '/usr/lib',
|
||||||
'/usr/local/lib',
|
'/usr/local/lib',
|
||||||
'/opt/lib'
|
'/opt/lib',
|
||||||
|
'/Library/Java/JavaVirtualMachines',
|
||||||
|
'/System/Library/Frameworks'
|
||||||
]),
|
]),
|
||||||
exists_directory(Root),
|
exists_directory(Root),
|
||||||
jdk_jre( Root, JRE).
|
jdk_jre( Root, JRE).
|
||||||
|
|
||||||
jdk_jre( Home, J ) :-
|
jdk_jre( Home, J ) :-
|
||||||
member(Extension, [java, jvm, 'jvm/*java*', 'jvm/*jdk*', 'jvm/*sun*' ] ),
|
member(Extension, [java, jvm, 'jvm/*java*', 'jvm/*jdk*', 'jvm/*sun*', 'jdk*/Contents/Home', 'JavaVM.framework/Home'] ),
|
||||||
absolute_file_name( Extension, [expand(true), relative_to(Home), access(exists), file_type( directory ), file_errors(fail), solutions(all) ], J0 ),
|
absolute_file_name( Extension, [expand(true), relative_to(Home), access(exists), file_type( directory ), file_errors(fail), solutions(all) ], J0 ),
|
||||||
pick_jdk_jre(J0, J).
|
pick_jdk_jre(J0, J).
|
||||||
|
|
||||||
|
|
||||||
pick_jdk_jre(J, J).
|
pick_jdk_jre(J, J).
|
||||||
pick_jdk_jre(J0, J) :-
|
pick_jdk_jre(J0, J) :-
|
||||||
absolute_file_name( 'jre*', [expand(true), relative_to(J0), access(exists), file_type( directory ), file_errors(fail), solutions(all) ], J ).
|
absolute_file_name( 'jre*', [expand(true), relative_to(J0), access(exists), file_type( directory ), file_errors(fail), solutions(all) ], J ).
|
||||||
@ -4523,11 +4526,15 @@ pick_jdk_jre(J0, J) :-
|
|||||||
|
|
||||||
|
|
||||||
libfile(Base, HomeLib, File) :-
|
libfile(Base, HomeLib, File) :-
|
||||||
java_arch( Arch ),
|
java_arch( Arch ),
|
||||||
jlib(Base, LBase),
|
jlib(Base, LBase),
|
||||||
atom_concat(['lib/',Arch,LBase], Lib),
|
atom_concat(['lib/',Arch,LBase], Lib),
|
||||||
absolute_file_name( Lib, [relative_to(HomeLib), access(read), file_type( executable), expand(true), file_errors(fail), solutions(all)], File ).
|
absolute_file_name( Lib, [relative_to(HomeLib), access(read), file_type( executable), expand(true), file_errors(fail), solutions(all)], File ).
|
||||||
|
libfile(Base, HomeLib, File) :-
|
||||||
|
jlib(Base, LBase),
|
||||||
|
atom_concat(['lib',LBase], Lib),
|
||||||
|
absolute_file_name( Lib, [relative_to(HomeLib), access(read), file_type( executable), expand(true), file_errors(fail), solutions(all)], File ).
|
||||||
|
|
||||||
jlib( jvm, '/server/libjvm' ).
|
jlib( jvm, '/server/libjvm' ).
|
||||||
jlib( jvm, '/client/libjvm' ).
|
jlib( jvm, '/client/libjvm' ).
|
||||||
jlib( java, '/libjava' ).
|
jlib( java, '/libjava' ).
|
||||||
@ -4597,7 +4604,7 @@ add_jpl_to_ldpath(JPL, File) :-
|
|||||||
[ file_type(executable),
|
[ file_type(executable),
|
||||||
access(read),
|
access(read),
|
||||||
file_errors(fail)
|
file_errors(fail)
|
||||||
]), !,
|
]),
|
||||||
file_directory_name(File, Dir),
|
file_directory_name(File, Dir),
|
||||||
prolog_to_os_filename(Dir, OsDir),
|
prolog_to_os_filename(Dir, OsDir),
|
||||||
current_prolog_flag(shared_object_search_path, PathVar),
|
current_prolog_flag(shared_object_search_path, PathVar),
|
||||||
@ -4660,7 +4667,7 @@ java_home_win_key(
|
|||||||
|
|
||||||
java_home(Home) :-
|
java_home(Home) :-
|
||||||
getenv('JAVA_HOME', Home),
|
getenv('JAVA_HOME', Home),
|
||||||
exists_directory(Home), !.
|
exists_directory(Home).
|
||||||
:- if(current_prolog_flag(windows, true)).
|
:- if(current_prolog_flag(windows, true)).
|
||||||
java_home(Home) :-
|
java_home(Home) :-
|
||||||
java_home_win_key(_, Key0), % TBD: user can't choose jre or jdk
|
java_home_win_key(_, Key0), % TBD: user can't choose jre or jdk
|
||||||
@ -4672,13 +4679,14 @@ java_home(Home) :-
|
|||||||
:- endif.
|
:- endif.
|
||||||
java_home(Home) :-
|
java_home(Home) :-
|
||||||
member(Home, [ '/usr/lib/java',
|
member(Home, [ '/usr/lib/java',
|
||||||
'/usr/lib/jvm',
|
'/usr/lib/jvm',
|
||||||
'/usr/lib/jvm/jre',
|
'/usr/lib/jvm/jre',
|
||||||
'/usr/local/lib/java',
|
'/usr/local/lib/java',
|
||||||
'/usr/local/lib/jvm',
|
'/usr/local/lib/jvm',
|
||||||
'/usr/local/lib/jvm/jre'
|
'/usr/local/lib/jvm/jre',
|
||||||
]),
|
'/Library/Java/JavaVirtualMachines',
|
||||||
exists_directory(Home).
|
'/System/Library/Frameworks'
|
||||||
|
]).
|
||||||
|
|
||||||
|
|
||||||
:- dynamic
|
:- dynamic
|
||||||
|
Reference in New Issue
Block a user