Architecting, installing and maintaining your SAS environment

SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 84
Accepted Solution

SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

Hi everyone,

 

I've just finish to install SAS 9.4 on my HP-UX server without any error. When executing the folloing example of SGPLOT on SAS EG 7.1, appears this error: ERROR: Unable to load the Java Virtual Machine.

 

Any idea?

 

Example execute:

proc format;
value agefmt
20-30 = "20 (*ESC*){unicode '2264'x} 30"
31-40 = "31 (*ESC*){unicode '2264'x} 40"
41-50 = "41 (*ESC*){unicode '2264'x} 50"
51-60 = "51 (*ESC*){unicode '2264'x} 60"
61-70 = "61 (*ESC*){unicode '2264'x} 70"
;
run;

proc sgplot data=sashelp.heart noautolegend;
title1 "Cholesterol Level by Age Range";
styleattrs datacolors=(red green purple orange cyan) backcolor=vpav wallcolor=pwh;
vbox cholesterol / category=AgeAtStart group=AgeAtStart;
format AgeAtStart agefmt.;
run;


Accepted Solutions
Solution
‎08-13-2017 10:12 AM
SAS Employee
Posts: 524

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

[ Edited ]

@MariaD,

 

Please change the following line in /sas9/software/SASFoundation/9.4/bin/sasenv_local:

 

SHLIB_PATH=/oracle/app/oracle/product/11.1.0/client_1/lib:/opt/IBM/db2/V9.1/lib64:$ODBCHOME/lib:/sas9/software/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin

 

to:

 

SHLIB_PATH=/oracle/app/oracle/product/11.1.0/client_1/lib:/opt/IBM/db2/V9.1/lib64:$ODBCHOME/lib:$SHLIB_PATH

Save the file and try to run proc javainfo once again.

View solution in original post


All Replies
Community Manager
Posts: 3,424

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

Try running:

 

proc javainfo; run;

Assuming that fails, you might need to configure your JRE options to point to the correct location. That's an install/admin task, so talk to your admin or reach out to SAS tech support.

Frequent Contributor
Posts: 84

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

Posted in reply to ChrisHemedinger

Thanks @ChrisHemedinger.

 

I've just run "proc options option=jreoptions; run;" (because javainfo give me the following error: ERROR: Proc javainfo did not run correctly).

 

JREOPTIONS=( -DPFS_TEMPLATE=/sas9/software/SASFoundation/9.4/misc/tkjava/qrpfstpt.xml
-Djava.class.path=/sas9/software/SASVersionedJarRepository/eclipse/plugins/sas.launcher.jar
-Djava.security.auth.login.config=/sas9/software/SASFoundation/9.4/misc/tkjava/sas.login.config
-Djava.security.policy=/sas9/software/SASFoundation/9.4/misc/tkjava/sas.policy
-Djava.system.class.loader=com.sas.app.AppClassLoader
-Dlog4j.configuration=file:/sas9/software/SASFoundation/9.4/misc/tkjava/sas.log4j.properties
-Dsas.app.class.path=/sas9/software/SASVersionedJarRepository/eclipse/plugins/tkjava.jar
-Dsas.ext.config=/sas9/software/SASFoundation/9.4/misc/tkjava/sas.java.ext.config
-Dtkj.app.launch.config=/sas9/software/SASVersionedJarRepository/picklist -Xmx256m -Xms128m )

 

I hd installed SASPrivateJavaRuntimeEnvironment. Where can I define the correct JRE location? On "sasenv_local"? 

 

Regards,

SAS Employee
Posts: 524

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

@MariaD,

 

Please run the following SAS program and show me the log:

 

options set=TKJNI_OPT_TRACE="y";
%put JAVA_HOME is: %sysget(JAVA_HOME);
%put CLASSPATH is: %sysget(CLASSPATH);
%put PATH is: %sysget(PATH);
%put SHLIB_PATH is: %sysget(SHLIB_PATH);
proc javainfo; run;
proc options option=jreoptions; run;
Frequent Contributor
Posts: 84

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

Thanks @alexal. Following the results. As mentioned previous, proc javainfo return and error:

 

25 GOPTIONS ACCESSIBLE;
26 options set=TKJNI_OPT_TRACE="y";
27 %put JAVA_HOME is: %sysget(JAVA_HOME);
JAVA_HOME is: /sas9/software/SASPrivateJavaRuntimeEnvironment/9.4/jre
28 %put CLASSPATH is: %sysget(CLASSPATH);
WARNING: The argument to macro function %SYSGET is not defined as a system variable.
CLASSPATH is:
29 %put PATH is: %sysget(PATH);
PATH is:
/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/gvsd/bin:/opt/ipf/bin:/opt/nettladm/bin:/opt/fcms/bin:
/opt/wbem/bin:/opt/wbem/sbin:/opt/sas/bin:/opt/graphics/common/bin:/opt/atok/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/sec_mgmt/bas
tille/bin:/opt/caliper/bin:/opt/drd/bin:/opt/dsau/bin:/opt/dsau/sbin:/opt/resmon/bin:/opt/firefox:/opt/gnome/bin:/opt/ignite/bin:/op
t/propplus/bin:/usr/contrib/kwdb/bin:/opt/perl_32/bin:/opt/perl_64/bin:/opt/prm/bin:/opt/sfm/bin:/opt/swm/bin:/opt/sec_mgmt/spc/bin:
/opt/ssh/bin:/opt/swa/bin:/opt/hpsmh/bin:/opt/thunderbird:/opt/sentinel/bin:/opt/langtools/bin:/opt/gwlm/bin:/oracle/app/oracle/prod
uct/11.1.0/client_1/bin:/opt/networker/bin:.:/home/sas/bin
30 %put SHLIB_PATH is: %sysget(SHLIB_PATH);
SHLIB_PATH is:
/oracle/app/oracle/product/11.1.0/client_1/lib:/opt/IBM/db2/V9.1/lib64:/sas9/software/AccessClients/9.4/SQLServer/lib:/sas9/software
/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin
NOTE: PROCEDURE JAVAINFO used (Total process time):
real time 1.04 seconds
cpu time 0.01 seconds

ERROR: Proc javainfo did not run correctly.
31 proc javainfo; run;


32 proc options option=jreoptions; run;

SAS (r) Proprietary Software Release 9.4 TS1M4

JREOPTIONS=( -DPFS_TEMPLATE=/sas9/software/SASFoundation/9.4/misc/tkjava/qrpfstpt.xml
-Djava.class.path=/sas9/software/SASVersionedJarRepository/eclipse/plugins/sas.launcher.jar
2 The SAS System 18:01 Saturday, August 12, 2017

-Djava.security.auth.login.config=/sas9/software/SASFoundation/9.4/misc/tkjava/sas.login.config
-Djava.security.policy=/sas9/software/SASFoundation/9.4/misc/tkjava/sas.policy
-Djava.system.class.loader=com.sas.app.AppClassLoader
-Dlog4j.configuration=file:/sas9/software/SASFoundation/9.4/misc/tkjava/sas.log4j.properties
-Dsas.app.class.path=/sas9/software/SASVersionedJarRepository/eclipse/plugins/tkjava.jar
-Dsas.ext.config=/sas9/software/SASFoundation/9.4/misc/tkjava/sas.java.ext.config
-Dtkj.app.launch.config=/sas9/software/SASVersionedJarRepository/picklist -Xmx256m -Xms128m )

 

Regards,

SAS Employee
Posts: 524

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

@MariaD,

 

Thanks for your response. Please show me the contents of the following file:

 

/sas9/software/SASFoundation/9.4/bin/sasenv_local

Frequent Contributor
Posts: 84

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

Thanks @alexal. Follows the contents requested: 

 

ORACLE_HOME=/oracle/app/oracle/product/11.1.0/client_1
export ORACLE_HOME

 

ODBCHOME=/sas9/software/AccessClients/9.4/SQLServer
export ODBCHOME

 

ODBCINI=$ODBCHOME/odbc.ini
export ODBCINI

 

SHLIB_PATH=/oracle/app/oracle/product/11.1.0/client_1/lib:/opt/IBM/db2/V9.1/lib64:$ODBCHOME/lib:/sas9/software/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin
export SHLIB_PATH

 

NLS_LANG=american_america.WE8ISO8859P1
export NLS_LANG


if [ "$LD_LIBRARY_PATH" != "" ] ; then
LD_LIBRARY_PATH=${SHLIB_PATH}:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$SHLIB_PATH
fi

export LD_LIBRARY_PATH

Solution
‎08-13-2017 10:12 AM
SAS Employee
Posts: 524

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

[ Edited ]

@MariaD,

 

Please change the following line in /sas9/software/SASFoundation/9.4/bin/sasenv_local:

 

SHLIB_PATH=/oracle/app/oracle/product/11.1.0/client_1/lib:/opt/IBM/db2/V9.1/lib64:$ODBCHOME/lib:/sas9/software/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin

 

to:

 

SHLIB_PATH=/oracle/app/oracle/product/11.1.0/client_1/lib:/opt/IBM/db2/V9.1/lib64:$ODBCHOME/lib:$SHLIB_PATH

Save the file and try to run proc javainfo once again.

Frequent Contributor
Posts: 84

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

Thanks @alexx. 

 

After applying the change suggested, the proc sgplot run perfectly. Thanks again!

 

 

Occasional Contributor
Posts: 5

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

Hello Everyone,

 

I have the same problem (Unable to load the JVM), and after doing what you wrote, nothing happened: I try to run a similar  What am I doing wrong? Any help would be appreciated.

 

Here is the content of my sasenv_local:


ORACLE_HOME=/OraApp/Oracle/Products/Client/121020
LD_LIBRARY_PATH=/OraApp/Oracle/Products/Client/121020/lib
TNS_ADMIN=/sas94/thirdparty/instantclient_11_2
NLS_LANG=HUNGARIAN_HUNGARY.AL32UTF8

SHLIB_PATH=/OraApp/Oracle/Products/Client/121020/lib:$SHLIB_PATH

if [ "$LD_LIBRARY_PATH" != "" ] ; then
LD_LIBRARY_PATH=${SHLIB_PATH}:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$SHLIB_PATH
fi


export ORACLE_HOME LD_LIBRARY_PATH TNS_ADMIN NLS_LANG

PATH=$PATH:$ORACLE_HOME/bin
export PATH

 

 

I run the following code:

options set=TKJNI_OPT_TRACE="y" ;

%put OS: &SYSSCP &SYSSCPL ;

%put SAS Mode: &SYSPROCESSNAME ;

%put SAS Version: &sysvlong ;

%put User: &SYSUSERID ;

%put SASROOT: %sysget(SASROOT) ;

%put JAVA_HOME is: %sysget(JAVA_HOME) ;

%put CLASSPATH is: %sysget(CLASSPATH) ;

%put PATH is: %sysget(PATH) ;

%put LD_LIBRARY_PATH is: %sysget(LD_LIBRARY_PATH) ;

proc javainfo ;

run ;

proc options option=jreoptions ;

run ;

 

And the log is as seen below:

 

OS: LIN X64 Linux

17 %put SAS Mode: &SYSPROCESSNAME ;

SAS Mode: Object Server

18 %put SAS Version: &sysvlong ;

SAS Version: 9.04.01M2P072314

19 %put User: &SYSUSERID ;

User: sasegrcins

20 %put SASROOT: %sysget(SASROOT) ;

SASROOT: /sas94/SAS/SASFoundation/9.4

21 %put JAVA_HOME is: %sysget(JAVA_HOME) ;

JAVA_HOME is: /sas94/SAS/SASPrivateJavaRuntimeEnvironment/9.4/jre

22 %put CLASSPATH is: %sysget(CLASSPATH) ;

WARNING: The argument to macro function %SYSGET is not defined as a system variable.

CLASSPATH is:

23 %put PATH is: %sysget(PATH) ;

PATH is:

/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/dell/srvadmin/bin:/home/sasegrcins/.local/bin:/home/sasegrcins/bin:/sas94/SAS

/SASPrivateJavaRuntimeEnvironment/9.4/jre/bin:/OraApp/Oracle/Products/Client/121020/bin:/OraApp/Oracle/Products/Client/121020/bin

24 %put LD_LIBRARY_PATH is: %sysget(LD_LIBRARY_PATH) ;

LD_LIBRARY_PATH is:

/OraApp/Oracle/Products/Client/121020/lib:/OraApp/Oracle/Products/Client/121020/lib:/opt/dell/srvadmin/lib64::/OraApp/Oracle/Product

s/Client/121020/lib

25

NOTE: PROCEDURE JAVAINFO used (Total process time):

real time 1.00 seconds

cpu time 0.01 seconds

 

ERROR: Proc javainfo did not run correctly.

26 proc javainfo ;

27 run ;

28

 

29 proc options option=jreoptions ;

30 run ;

SAS (r) Proprietary Software Release 9.4 TS1M2

JREOPTIONS=( -DPFS_TEMPLATE=/sas94/SAS/SASFoundation/9.4/misc/tkjava/qrpfstpt.xml

The SAS System

-Djava.class.path=/sas94/SAS/SASVersionedJarRepository/eclipse/plugins/sas.launcher.jar

-Djava.security.auth.login.config=/sas94/SAS/SASFoundation/9.4/misc/tkjava/sas.login.config

-Djava.security.policy=/sas94/SAS/SASFoundation/9.4/misc/tkjava/sas.policy

-Djava.system.class.loader=com.sas.app.AppClassLoader -Djdk.lang.Process.allowAmbigousCommands=true

-Dlog4j.configuration=file:/sas94/SAS/SASFoundation/9.4/misc/tkjava/sas.log4j.properties

-Dsas.app.class.path=/sas94/SAS/SASVersionedJarRepository/eclipse/plugins/tkjava.jar

-Dsas.ext.config=/sas94/SAS/SASFoundation/9.4/misc/tkjava/sas.java.ext.config

-Dtkj.app.launch.config=/sas94/SAS/SASVersionedJarRepository/picklist )

Specifies the Java Runtime Environment options for SAS.

 

Thank you,

Barnabas

SAS Employee
Posts: 524

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

[ Edited ]
Posted in reply to dsdsdssss

@dsdsdssss,

 

Change line number two from:

 

LD_LIBRARY_PATH=/OraApp/Oracle/Products/Client/121020/lib

 

to

 

LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/OraApp/Oracle/Products/Client/121020/lib

 

Also, you do not need these lines, remove them:

 

SHLIB_PATH=/OraApp/Oracle/Products/Client/121020/lib:$SHLIB_PATH
if [ "$LD_LIBRARY_PATH" != "" ] ; then
LD_LIBRARY_PATH=${SHLIB_PATH}:$LD_LIBRARY_PATH
else
LD_LIBRARY_PATH=$SHLIB_PATH
fi 
Occasional Contributor
Posts: 5

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

Wow, many many thanks to you, alexal, it works fine! (I've tried plenty of variations in the past few hours without success)

 

Smiley Happy

SAS Employee
Posts: 524

Re: SAS 9.4 - Proc SGPLOT: Unable to load the Java Virtual Machine

Posted in reply to dsdsdssss

@dsdsdssss,

 

You are welcome.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 12 replies
  • 1302 views
  • 2 likes
  • 4 in conversation