Aptitud Intuitiva

jueves, 29 de abril de 2010

SuperLienzo en Scilab 5.2.2


Saludos, la presente es para comentarles que he realizado todas las pruebas a la nueva versión de scilab y su interfaz con Java (javasci) y existe compatibilidad absoluta, mejor incluso que la versión 5.2.1, la cual generaba unos mensajes de advertencia en la cónsola. Las pruebas las realicé en Ubuntu 9.10 (mañana lo probaré en Ubuntu 10.04!!)

A continuación incluyo unos cuantos enlaces a este blog referente a javasci y a SuperLienzo:



Cualquier duda la pueden enviar por este medio.

Atentamente:

Ing. Manuel Pérez P.

13 comentarios:

  1. Saludos, javasci funciona perfectamente bajo el nuevo Ubuntu 10.04

    ResponderEliminar
  2. Hello,

    i just tried to use SciLab (javasci) 5.2.1 under Ubuntu 10.04 and well i always got this error:

    /home/userdev/jMonitorControl/jMonitorControl.sh

    could you please send me a complete scritp (LD_LIBRARY_PATH and so on...) to let it work under ubuntu 10.04 pls.

    My email is: pietro.galassi@gmail.com

    Best regards.

    ResponderEliminar
  3. Saludos Pietro, I need to know wich class are you trying to run. Please, send me the full error message (the exception message), your .bash file and the scilab path in your PC.

    (Please, forgive my English)

    ResponderEliminar
  4. ========================================================================
    THIS IS THE BASH.RC
    ========================================================================
    [ -z "$PS1" ] && return

    HISTCONTROL=ignoredups:ignorespace

    shopt -s histappend

    HISTSIZE=1000
    HISTFILESIZE=2000

    shopt -s checkwinsize

    [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

    if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
    fi

    case "$TERM" in
    xterm-color) color_prompt=yes;;
    esac

    if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
    fi

    if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    fi
    unset color_prompt force_color_prompt

    case "$TERM" in
    xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
    *)
    ;;
    esac

    if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
    fi

    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'

    if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
    fi

    if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
    fi

    export PATH=${PATH}:~/android-sdk-linux_86/tools
    ========================================================================
    THIS IS THE TEST CODE I DID
    ========================================================================
    import javasci.Scilab;

    public class DisplayPI {
    public static void main(String []args){
    Scilab.Exec("disp(%pi);");
    }
    }

    compiled with:
    javac -cp /usr/share/java/javasci.jar ...
    ========================================================================
    THIS IS THE THE ERROR I GET
    ========================================================================
    SCILAB PATH as installed in Ubuntu 10.04 using package manager is:

    userdev@pc-sviluppo:~/Scrivania/javasci$ whereis scilab
    scilab: /usr/bin/scilab /usr/lib/scilab /usr/include/scilab /usr/share/scilab /usr/share/man/man1/scilab.1.gz

    ========================================================================
    ========================================================================
    THIS IS THE THE ERROR I GET
    ========================================================================
    xception in thread "main" java.lang.NoClassDefFoundError: javasci/Scilab
    at DisplayPI.main(DisplayPI.java:8)
    Caused by: java.lang.ClassNotFoundException: javasci.Scilab
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 1 more




    Thanks a lot

    ResponderEliminar
  5. Saludos Pietro, to work this class you need:
    1. Uninstall scilab form packege manager Synaptic
    2. Download scilab from http://www.scilab.org/download/5.2.2/scilab-5.2.2.bin.linux-i686.tar.gz (this is updated and works better in ubuntu)
    3. Unzip to a folder in your main personal folder (in my case: /home/YAGAMI/scilab/)
    4. You must to add this lines to the .bashrc file (this is in your personal folder):
    LD_LIBRARY_PATH=/home/YAGAMI/scilab5/lib/scilab:/home/YAGAMI/scilab5/lib/thirdparty
    export SCI=/home/YAGAMI/scilab5/share/scilab
    export SCI_DISABLE_TK=1
    export SCI_JAVA_ENABLE_HEADLESS=1
    (remember the path must be where you unzip scilab)

    LISTO!! This should work in your pc
    Any doubt you can go to: http://jingmap.blogspot.com/2009/11/javasci-javascilab-en-gnulinux.html

    I hope that helps (Sorry for my english)

    ResponderEliminar
  6. well, i would like to use the standard installation that comes with Ubuntu 10.04 with it's standard installation tree.

    Do you have any tips on how let it work ? I have used the follow:

    userdev@pc-sviluppo:~/Scrivania/javasci$ export LD_LIBRARY_PATH=/usr/lib/scilab
    userdev@pc-sviluppo:~/Scrivania/javasci$ export SCI=/usr/share/scilab
    userdev@pc-sviluppo:~/Scrivania/javasci$ export SCI_DISABLE_TK=1
    userdev@pc-sviluppo:~/Scrivania/javasci$ export SCI_JAVA_ENABLE_HEADLESS=1


    then compiled with:
    userdev@pc-sviluppo:~/Scrivania/javasci$ javac -cp /usr/share/java/javasci.jar DisplayPI.java

    but running the program with:

    java DisplayPi

    gives:

    Exception in thread "main" java.lang.NoClassDefFoundError: javasci/Scilab
    at DisplayPI.main(DisplayPI.java:8)
    Caused by: java.lang.ClassNotFoundException: javasci.Scilab
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 1 more


    same thing if i try to run the program with:

    java -Djava.library.path=/usr/share/java/ DisplayPI


    Hope u can help.

    ResponderEliminar
  7. Saludos, I don't like this instalation, don't have a good performance.
    In your case, your JVM can't find javasci.jar path, try this:
    Download the javasci source from: http://sites.google.com/site/aptitudintuitiva/archivos/javasci.zip?attredirects=0&d=1
    Unzip the file and put the javasci folder in the same path of your DisplayPI.java.
    This should work.
    (Sorry for my English)

    ResponderEliminar
  8. Saludos, same erros? Remember, the javasci folder must be in the same DisplayPI path

    ResponderEliminar
  9. Saludos, try with download scilab5.2.2 and unzip it, don't use the scilab from ubuntu. The scilab5.2.2 it's binary, no require compile, only unzip. Try this example http://sites.google.com/site/aptitudintuitiva/archivos/DemoCodigo.zip?attredirects=0&d=1

    ResponderEliminar
  10. Saludos Manuel, segui tu recomendación y me mude a mi amado ubuntu, he configurado el archivo /etc/environment y escribi las variables asi:

    LD_LIBRARY_PATH="/opt/scilab-5.3.0/lib/scilab:/opt/scilab-5.3.0/lib/thirdparty"
    SCI="/opt/scilab-5.3.0/share/scilab"
    SCI_DISABLE_TK=1
    SCI_JAVA_ENABLE_HEADLESS=1

    pero el eclipse arroja el mismo error que en guindous 7:

    The native library javasci does not exist or cannot be found.
    java.lang.UnsatisfiedLinkError: no scilab in java.library.path

    Alguna recomendación??!!

    ResponderEliminar
  11. Saludos Miguel, por alguna razón que aún no conozco, los cmabios que haces en el .bashrc no son tomaods en cuenta por el servidor gráfico de Linux. Mientras consigo la solución definitiva, lo siguiente funciona con NetBeans, arrancar el IDE, en tu caso eclipse, desde el shell (terminal o consola) y debería funcionar. Te comento que algunos ejemplos mostrados acá podrían no funcionar, ya que la sintaxis de javasci2 es muy distinta a javasci. Revisa http://jingmap.blogspot.com/2011/01/democodigo20-beta-primer-proyecto.html, allí actualicé algunos de los proyectos presentados en éste blog. Cualquier duda seguimos a la orden.

    ResponderEliminar

Información muy importante

INFORMACIÓN IMPORTANTE