starting clipsjni

772 views
Skip to first unread message

Arpit

unread,
Jun 6, 2012, 6:38:48 AM6/6/12
to CLIPSESG
hello,
I am on linux platform(ubuntu) and was getting some problem with
starting clipsjni.
I have executed the make command(as given in the document) 'make -f
makefile.linux'. It worked fine but then when i try to run clipsjni as
follows:

java -cp CLIPSJNI.jar CLIPSJNI.Environment

it says an error: Could not find the main class: CLIPSJNI.Environment.
Program will exit.
Any help in this regard??
P.S: I am a beginner so plz explain in a basic manner ;)
Thanks

Lode Hoste

unread,
Jun 10, 2012, 4:49:28 PM6/10/12
to clip...@googlegroups.com
Hi Arpit,

1) Modify the makefile with your java-jdk path
(-I/usr/lib/jvm/java-6-sun-1.6.0.26/include/
-I/usr/lib/jvm/java-6-sun-1.6.0.26/include/linux/ for ubuntu) // I
assume you managed to do this
2) cp library-src/libCLIPSJNI.so .
3) java -cp CLIPSJNI.jar CLIPSJNI.Environment

2012/6/6 Arpit <arpi...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
> To post to this group, send email to CLIP...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/CLIPSESG?hl=en
>
> --> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
> Click on "Edit my membership" link.
> Select the "No Email" radio button.
> Click the "Save these settings" button.
>
> --> IF YOU WANT TO UNSUBSCRIBE <--
> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
> Sign in
> Click on "Edit my membership" link.
> Click the "Unsubscribe" button.
> Note: This appears to be the most reliable way to unsubscribe
>
> Alternately, send email to CLIPSESG-u...@googlegroups.com. You will receive an email which you must respond to as well to unsubscribe. Clicking the link mentioned in the unsubscribe reply does not appear to work reliably.

Arpit

unread,
Jun 14, 2012, 1:26:29 AM6/14/12
to clip...@googlegroups.com

Hi Lode,
I have set the path for java-openjdk in the makefile but I don't know where to set cp library-src/libCLIPSJNI.so. I mean, do I have to set it in the makefile itself and how exactly(like after which line and between which delimiters).

If I am correct the cp here stands for classpath ....right?

Thanks.
> Alternately, send email to CLIPSESG-unsubscribe@googlegroups.com. You will receive an email which you must respond to as well to unsubscribe. Clicking the link mentioned in the unsubscribe reply does not appear to work reliably.

Lode Hoste

unread,
Jun 14, 2012, 2:57:56 AM6/14/12
to clip...@googlegroups.com

No, you should copy the .so file to the folder where your .jar is located. They belong together. Sorry for the confusion.
(cp = copy)

Alternately, send email to CLIPSESG-u...@googlegroups.com. You will receive an email which you must respond to as well to unsubscribe. Clicking the link mentioned in the unsubscribe reply does not appear to work reliably.

Arpit

unread,
Jun 14, 2012, 3:00:48 AM6/14/12
to clip...@googlegroups.com
Yes precisely....that I did already.
But it said "Could not find the main class: CLIPSJNI.Environment. 

Lode Hoste

unread,
Jun 14, 2012, 3:39:23 AM6/14/12
to clip...@googlegroups.com
ok I don't know what could be wrong but to help you further, please
report the output of the following linux commands:

0) go to the folder where your jar and .so file is located
1) "uname –a"
(checking 32 vs 64bit)
2) "du -h *"
(to see whether the .so was compiled successfully)
3) "java -version"
(if you are using openJDK, you could try to install the Java from
Oracle: http://www.ubuntugeek.com/how-to-install-oracle-java-7-in-ubuntu-12-04.html)


2012/6/14 Arpit <arpi...@gmail.com>:
>>>> > Alternately, send email to CLIPSESG-u...@googlegroups.com. You
>>>> > will receive an email which you must respond to as well to unsubscribe.
>>>> > Clicking the link mentioned in the unsubscribe reply does not appear to work
>>>> > reliably.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "CLIPSESG" group.
>>> To post to this group, send email to CLIP...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/CLIPSESG?hl=en
>>>
>>> --> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
>>> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
>>> Click on "Edit my membership" link.
>>> Select the "No Email" radio button.
>>> Click the "Save these settings" button.
>>>
>>> --> IF YOU WANT TO UNSUBSCRIBE <--
>>> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
>>> Sign in
>>> Click on "Edit my membership" link.
>>> Click the "Unsubscribe" button.
>>> Note: This appears to be the most reliable way to unsubscribe
>>>
>>> Alternately, send email to CLIPSESG-u...@googlegroups.com. You
>>> will receive an email which you must respond to as well to unsubscribe.
>>> Clicking the link mentioned in the unsubscribe reply does not appear to work
>>> reliably.
>
> --
> You received this message because you are subscribed to the Google Groups
> "CLIPSESG" group.
> To post to this group, send email to CLIP...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/CLIPSESG?hl=en
>
> --> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
> Click on "Edit my membership" link.
> Select the "No Email" radio button.
> Click the "Save these settings" button.
>
> --> IF YOU WANT TO UNSUBSCRIBE <--
> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
> Sign in
> Click on "Edit my membership" link.
> Click the "Unsubscribe" button.
> Note: This appears to be the most reliable way to unsubscribe
>
> Alternately, send email to CLIPSESG-u...@googlegroups.com. You will

Arpit Jain

unread,
Jun 14, 2012, 5:57:16 AM6/14/12
to clip...@googlegroups.com
The following are the respective outputs:
1) Linux ubuntu 3.2.0-24-generic-pae #39-Ubuntu SMP Mon May 21 18:54:21 UTC 2012 i686 i686 i386 GNU/Linux
2)124K ./java-src/CLIPSJNI
128K ./java-src
40K ./examples/SudokuDemo/resources
148K ./examples/SudokuDemo
104K ./examples/AnimalDemo/resources
168K ./examples/AnimalDemo
40K ./examples/WineDemo/resources
108K ./examples/WineDemo
44K ./examples/AutoDemo/resources
92K ./examples/AutoDemo
520K ./examples
9.9M ./library-src
18M .
3) java version "1.6.0_24"
OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
OpenJDK Server VM (build 20.0-b12, mixed mode)
Regards,
Arpit Jain

Lode Hoste

unread,
Jun 14, 2012, 7:00:20 AM6/14/12
to clip...@googlegroups.com
2012/6/14 Arpit Jain <arpi...@gmail.com>:
> The following are the respective outputs:
> 1) Linux ubuntu 3.2.0-24-generic-pae #39-Ubuntu SMP Mon May 21 18:54:21 UTC
> 2012 i686 i686 i386 GNU/Linux
ok, no problems here

> 2)124K ./java-src/CLIPSJNI
> 128K ./java-src
> 40K ./examples/SudokuDemo/resources
> 148K ./examples/SudokuDemo
> 104K ./examples/AnimalDemo/resources
> 168K ./examples/AnimalDemo
> 40K ./examples/WineDemo/resources
> 108K ./examples/WineDemo
> 44K ./examples/AutoDemo/resources
> 92K ./examples/AutoDemo
> 520K ./examples
> 9.9M ./library-src
> 18M .

that's not the folder where the jar is located

> 3) java version "1.6.0_24"
> OpenJDK Runtime Environment (IcedTea6 1.11.1) (6b24-1.11.1-4ubuntu3)
> OpenJDK Server VM (build 20.0-b12, mixed mode)

try to change to the oracle java vm using this guide:
http://www.ubuntugeek.com/how-to-install-oracle-java-7-in-ubuntu-12-04.html

Arpit Jain

unread,
Jun 15, 2012, 1:41:05 AM6/15/12
to clip...@googlegroups.com
I tried following the steps given on ubuntugeek.com but it gave an error. So I am continuing with openjdk.
And, by the .jar file which file do you mean? Is it the CLIPSJNI.jar located in the main directory or some other directory. 
When I run 'du -h' in the main directory ('CLIPSJNI v0.3') it gave the output as specified in the previous mail. When I run it in library-src, it  gave '9.9 M'.
And also, I have copied the .so file to the main directory 'CLIPSJNI v0.3', and it still gives the same error.
Any help? 

Lode Hoste

unread,
Jun 15, 2012, 7:03:18 AM6/15/12
to clip...@googlegroups.com
ok, let's retry this step by step:

1) unzip CLIPSJNI.zip
2) cd CLIPSJNI/library-src
3) edit makefile.linux
- gcc -o libCLIPSJNI.so -shared -Wall
-I/opt/sun-j2sdk-1.4.2/include -I/opt/sun-j2sdk-1.4.2/include/linux
-lm $(OBJS) CLIPSJNI_Environment.c
-> gcc -o libCLIPSJNI.so -shared -Wall
-I/usr/lib/jvm/java-6-openjdk/include
-I/usr/lib/jvm/java-6-openjdk/include/linux -lm $(OBJS)
CLIPSJNI_Environment.c
4) make -f makefile.linux
5) copy libCLIPSJNI.so to your CLIPSJNI main folder, where the .jar is
also located
6) In your 'main' folder you now have:
libCLIPSJNI.so
CLIPSJNI.jar
7) execute the sample "java -Djava.library.path=. -cp CLIPSJNI.jar
CLIPSJNI.Environment"
Note: the example in the README does not use the -Djava.library.path
option, it seems this is necessary for the OpenJDK runtime.



2012/6/15 Arpit Jain <arpi...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages