-
Notifications
You must be signed in to change notification settings - Fork 51
Could not find class dev.SASJavaExec #3
Comments
The most logically explanation is that you did not properly configure your CLASSPATH environment variable. Example to validate CLASSPATH here You can set this in your SAS session by using the SET Option before you data step.
|
Hi @FriedEgg , |
and I attached the following code for your reference.
options set=classpath "C:\Users\c244032\Documents\SAS_Base_OpenSrcIntegration\bin";
%let WORK_DIR = C:\Users\c244032\Documents\SAS_Base_OpenSrcIntegration;
data _null_;
length rtn_val 8;
*** Python program takes working directory as first argument;
python_pgm = "&WORK_DIR.\digitsdata_svm.py";
python_arg1 = "&WORK_DIR";
python_call = cat('"', trim(python_pgm), '" "', trim(python_arg1), '"');
declare javaobj j("dev.SASJavaExec", "python", python_call);
j.callIntMethod("executeProcess", rtn_val);
run; |
Judging solely by the pictures you have posted, the compiled class files appear to be in a different location in the first post you made than in the second. There is still no reason to assume that the CLASSPATH not being set correctly is the item at fault here. Can you verify that in you second post, the bin directory "C:\Users\c244032\Documents\SAS_Base_OpenSrcIntegration\bin" contains the subfolder "dev" which subsequently contain the file "SASJavaExec.class" Try running the following in SAS and see what it says:
|
@FriedEgg , Sorry for the late response as I was in vacation in last week. and also thanks very much for your quick response.
it shows
|
@FriedEgg It is the same error that @77QingLiu faces which I am facing now. I have a doubt, in the document given for this: It has been specified that in the initial setup that Two Java classes: SASJavaExec.java and StreamManagerThread.java will get downloaded in the WORK_DIR which is not the case. Is that the problem ,that I am facing where the Error as "Could not find class dev.SASJavaExec" |
@vishwath13 The pdf needs to be updated i.e., you no longer need two files as the content of StreamManagerThread.java was merged into SASJavaExec.java, hence you only need the latter. There is a note in the readme that I am copying below that might help. Which version of Java did you use to compile? NOTE: This project was compiled with Oracle JDK 1.7.0_25. We highly recommend using Java 7 to compile the java files in this project. When class files generated by some versions of Java 8 are used, the Base SAS Java Object fails with the following error: |
@rmyneni Thank you so much. It is the same error except for the last line. Where can I find the updated PDF Document and I tried using Oracle JDK 1.6.0_some version and later using 1.8.0_161. Should I specifically try with Java 7 version ? If so, Can you send me a link where I can download Java 7 version ? I was only able to get Java 8 versions available online. |
@vishwath13 The PDF is accurate except for the list of classes you need -- that is, you only need SASJavaExec.java file. We have not tested with Java 6 so cannot comment on that but here is the Java 7 download site: http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html |
Hi, Do you solution to this. kindly help |
I am getting same issue. PLease see below 231 ERROR: Could not find class classfile/Classfile at line 233 column 23. Please ensure that the 237 239 PROC OPTIONS option=jreoptions;
JREOPTIONS=( -DPFS_TEMPLATE=C:\Program 241 PFS_TEMPLATE = C:\Program Files\SASHome\SASFoundation\9.4\tkjava\sasmisc\qrpfstpt.xml log4j.configuration = NOTE: PROCEDURE JAVAINFO used (Total process time): |
@praveensas are you failing running code from repo enlighten-integration/SAS_Base_OpenSrcIntegration or just trying to use JavaObj in Base SAS. Either way, you (1) need to compile Java class(es) that you want to use and (2) add them to the CLASSPATH of Base SAS installation. The pdf in this repo explains how to do that with an example -- see sections "Compiling the provided java classes" and "Setting the Java CLASSPATH" Your code is using: Hope this helps! |
@filbert11 - looks like the code is trying to run the following command but not finding some file along the way - do you have all these directories specified correctly? and can you run this command ok say in windows command prompt? |
That error is coming directly from Python, maybe you don't have all the needed dependencies installed. Any line in the log that starts with "INFO: PROCESS OUTPUT >>>" is coming from Python. |
Hello,
I use the following sas code to run python program,
but I got a error
I pretty sure I follow your instruction, but still the SAS could not find the dev.SASJavaExec class.
The text was updated successfully, but these errors were encountered: