help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: java and linux


From: Scott Haynes
Subject: Re: java and linux
Date: Tue, 1 Jul 2008 22:02:43 -0700 (PDT)

I'm glad to see this post. I too would like to run Jhandles on Linux but have
not had much luck. I have compiled and installed the package but it doesn't
work and perhaps others on the list will be able to help figure out why.
First, I read somewhere on Nabble that JOGL must be built from the source
using  java version 1.6 or less. 

With this in mind here iis the  background on my system and how I built the
code. First, I am running fedora 8,  octave version 3.0.0,  octave java
1.2.2 and jhandles 0.3.3 . Java 1.2.2 was included with octave-forge which I
installed using yum instead of the package manager (The package manager
doesn't seem to work on my machine).   

I started by first downloading  “jdk1.6.0_06”  from sun.  I  placed this in
my home directory, subdirectory apps ( you can place it anywhere).  I set
the environmental variable JAVA_HOME as follows:

export JAVA_HOME=/home/scott/apps/jdk1.6.0_06/

I downloaded  both gluegen and jogl from the following link:

http://download.java.net/media/jogl/builds/nightly/jogl-1.1.2-pre-20080523-src.zip

I unziped and detar'ed this file in the apps directory which yielded two
folders :

/home/scott/apps/gluegen
/home/scott/apps/jogl

I cd'ed into the gluegen folder, subfolder “make” . In this folder are two
files , build.xml and gluegen.properties. I first opened up
gluegen.properties and uncommented line 13 (ie antlr.jar linux path,  I set
this path to : /usr/share/java/antlr.jar)
 .  I have two versions of Java on my computer so I wanted to make sure I
was using version 1.6 for the build so I scanned down the build.xml file to
determine where this was set. At about line 176 it appears that the
JAVA_HOME environmental variable is used to determine which version of  java
to use. I next used “ant” to build gluegen (ie at the prompt I typed “ant”). 
After a successful build of gluegen the following jar files were made in the
gluegen/build folder:

antlr.jar  
gluegen-rt.jar
gluegen.jar
gluegen-rt-natives-linux-i586.jar

I next cd'ed back to the apps/jogl folder, subfolder “make”. I opened up
build.xml and added the following three lines right after line 51 which has
“<project name="JOGL" basedir="." default="all">” appearing on it.

<property name="user.home" value="/home/scott/apps/jogl" />

<property name="gluegen.root" value="/home/scott/apps/gluegen" />

<property name="java.home.dir" value="/home/scott/apps/jdk1.6.0_06/" />

I had to make additional changes latter on in the build.xml script,
specifically to the “syslibset” tag but I think that's a Fedora thing which
you shouldn't need to worry about.  Again I saved my changes to build, typed
ant at the command prompt which yielded  : jogj.jar in the jogl/build
directory. 

Next I downloaded and unzipped both java-1.2.2 and jhandles-0.3.3 to the
apps folder.  I didn't bother to rebuild java-1.2.2 but as you will see 
“__java__.h” is required for the build and this file is not included in
octave forge. I cd'ed into apps/jhandles-0.3.3/src folder and  ran
./configure which made the file “Makeconf
”. I edited this file to include the correct paths, ie... on my machine they
were

JAVAC = javac

JAR = jar

JAVA_HOME = /home/scott/apps/jdk1.6.0_06

JAVA_ARCH = i386

JAVA_LIBS = 

JAVA_INCS = -I/home/scott/apps/jdk1.6.0_06/include
-I/home/scott/apps/jdk1.6.0_06/include/linux

HAVE_JAVA = yes



JOGL_JAR = /home/scott/apps/jogl/build/jogl.jar

OCTAVE_JAR = /home/scott/apps/java-1.2.2/octave.jar

OCTAVE_JAVA_DIR = /home/scott/apps/java-1.2.2

OCTAVE_JAVAOCT_DIR = 

OCTAVE_PATHSEP = :

I then copied  “__java__.h”  from java-1.2.2/src/ to jhandles-0.3.3/src/. I
made no changes to the “makefile” file aside from adding a verbose option
under “%.jar”.  This is not required for the build but it was helpful as I
was able to determine that the classpath flag “-cp” does not work (which is
weird). Because of this I placed symbolic links to all the gluegen and jogj
jar files in the /home/scott/apps/jdk1.6.0_06/jre/lib/ext/ folder. I then
typed “make all” from within handles-0.3.3/src/ which yielded  jhandles.jar
,__jhandles__.oct  and libgl2ps_java.so. 

At this point I opened up my octaverc file and added the following lines
which are primarily from the PKG_ADD script.

putenv('JAVA_HOME','/home/scott/apps/jdk1.6.0_06/');

putenv('LD_LIBRARY_PATH',['/home/scott/apps/gluegen/build:', ...

       '/home/scott/apps/jogl/build:']);
addpath('/home/scott/apps/jhandles-0.3.3/inst')

javaaddpath('/home/scott/apps/jhandles-0.3.3/inst/jhandles.jar');

javaaddpath('/home/scott/apps/jogl/build/jogl.jar'); 

javaaddpath('/home/scott/apps/gluegen/build/antlr.jar');

javaaddpath('/home/scott/apps/gluegen/build/gluegen-rt.jar'); 

javaaddpath('/home/scott/apps/gluegen/build/gluegen.jar');

dispatch ("get", "__jhandles_get", "any");

dispatch ("set", "__jhandles_set", "any");

dispatch ("ishandle", "__jhandles_ishandle", "any");

dispatch ("__go_figure__", "__jhandles_go_figure", "any");

dispatch ("__go_delete__", "__jhandles_go_delete", "any");

dispatch ("__go_axes__", "__jhandles_go_axes", "any");

dispatch ("__go_axes_init__", "__jhandles_go_axes_init", "any");

dispatch ("__go_text__", "__jhandles_go_text", "any");

dispatch ("__go_surface__", "__jhandles_go_surface", "any");

dispatch ("__go_image__", "__jhandles_go_image", "any");

dispatch ("__go_patch__", "__jhandles_go_patch", "any");

dispatch ("__go_line__", "__jhandles_go_line", "any");

atexit ("__jhandles_exit");

mark_as_command shading;

mark_as_command legend;

mark_as_command hidden;

mark_as_command colorbar;

java_invoke ("java.lang.System", "setProperty", "octave.jhandles.path", ...

              fileparts (mfilename ("fullpath")));

I then opened up octave and typed “figure” which yielded the following
error:

error: [java] java.lang.UnsatisfiedLinkError: no gluegen-rt in
java.library.path

error: evaluating if command near line 25, column 3

error: called from `__jhandles_go_figure' in file
`/home/scott/apps/jhandles-0.3.3/inst/__jhandles_go_figure.m'

error: evaluating assignment expression near line 67, column 9

error: evaluating if command near line 66, column 5

error: evaluating if command near line 65, column 3

error: called from `figure' in file
`/usr/share/octave/3.0.0/m/plot/figure.m'


This tells me that the gluegen-rt.jar file can't be found despite the
symbolic link being present in the /home/scott/apps/jdk1.6.0_06/jre/lib/ext/
folder.  The weird thing is next time I type “figure” the error message
changes to :

error: [java] java.lang.NoClassDefFoundError: Could not initialize class
com.sun.opengl.impl.x11.X11GLDrawableFactory

error: evaluating if command near line 25, column 3

error: called from `__jhandles_go_figure' in file
`/home/scott/apps/jhandles-0.3.3/inst/__jhandles_go_figure.m'

error: evaluating assignment expression near line 67, column 9

error: evaluating if command near line 66, column 5

error: evaluating if command near line 65, column 3

error: called from `figure' in file
`/usr/share/octave/3.0.0/m/plot/figure.m'

Which just says that jogl is screwed up. 

Anyway, I'm not certain how helpful this will be given I haven't been able
to make jhandles work on my system but perhaps someone else will have some
idea where I have gone wrong.

Good Luck!



   


 



jjanmaat wrote:
> 
> Hello,
> 
> I'm trying to install jhandles on a SLED 10 linux distribution.  I've
> learned that I need the java package first.  When I try to install that
> one, I get the complaint that the Java Source Development Kit is not
> found, and it does not install.
> 
> I've done a forced upgrade of the octave package, to no avail.
> 
> Any other ideas?
> 
> John.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
> 
> 

-- 
View this message in context: 
http://www.nabble.com/java-and-linux-tp18206506p18230358.html
Sent from the Octave - General mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]