Re: Calling Java objects from C++
Naoki Shibuya wrote: > > Hi, > > I'm looking for a way to call Java objects from C++. > Is this possible using JNI? Yes, it is possible. There are two scenarios: 1. you want to call methods of Java objects while you are in C++ code that is the native implementation of a method of another Java object. In this case, you have to pass the object you want to call methods upon as a parameter to the native method. 2. you want to execute Java code while you are in unrelated C++ code. Then, you have to create an instance of the Java virtual machine to execute the code in. This is much like calling 'java classname' from the command line. For details look at the JNI documentation - it's difficult to summarize. Matthias Pfisterer -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Problem aobut running javac & appletviewer...
Hi, When I run javac & appletviewer, I got the following message: /usr/local/jdk117_v1a/bin/checkVersions: /tmp/ldd.out.10047:Permission denied. /usr/local/jdk117_v1a/bin/i586/green_threads/appletviewer: /usr/bin/mkdir: No such file or directory SIGSEGV 11* segmentation violation stackbase(null), stackpointer=(null) Does this mean that anything wrong on my setting? (I am using RedHat 6) Regards, Tohru _ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Compile OK but not Run
> After an installation de jdk1.2 on Linux RedHat 6 > > I can Compile with javac in Xterm windows and i get one file.class > > When i would run this file.class i use "java file.class" and it return this error : > at java.lang.NoClassDefFoundError. you have to give like "java file" not "java file.class Linux saggi's -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: VisualAge for Java for Linux
Alex Rice wrote: > > Yes, everyone, check it out. Visual Age for Java is a great > development environment. > > Alex Rice|[EMAIL PROTECTED]|http://www.swcp.com/~alrice > Current Location: N. Rio Grande Bioregion, Southwestern USA > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] Everyone, I agree with Alex because Visual Age is probably one of the more stabler ide compared to ones like Visual Cafe that exists on the M$ side. The only thing that it is lacking is support for JDK 1.2/Swing 1.1+ which is okay because I can just export mystuf, change headers for 1.1 and then recompile since I have Swing 1.1 on my system. Matt Brown -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: VisualAge for Java for Linux
It is Pure java, which will run anywhere ? Or is it just for linux/intel :-/ gat Alex Rice wrote: > On Thu, 17 Jun 1999 09:57:39 -0400, > "Jauvane Cavalcante de Oliveira" <[EMAIL PROTECTED]> said: > > Jauvane> http://www7.software.ibm.com/vadreg.nsf/GARegistration?OpenForm > Jauvane> free of charge. The download page is > Jauvane> http://www.software.ibm.com/ad/vadd > > Jauvane> Let us let them know how big the Linux-Java community is :-) > Jauvane> (As if they didn't know it already). > -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: VisualAge for Java for Linux
On Thu, 17 Jun 1999 09:57:39 -0400, "Jauvane Cavalcante de Oliveira" <[EMAIL PROTECTED]> said: Jauvane> http://www7.software.ibm.com/vadreg.nsf/GARegistration?OpenForm Jauvane> free of charge. The download page is Jauvane> http://www.software.ibm.com/ad/vadd Jauvane> Let us let them know how big the Linux-Java community is :-) Jauvane> (As if they didn't know it already). Yes, everyone, check it out. Visual Age for Java is a great development environment. Alex Rice|[EMAIL PROTECTED]|http://www.swcp.com/~alrice Current Location: N. Rio Grande Bioregion, Southwestern USA -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Java for Linux performance
Is OpenSpot available for Linux? I have a server-side Java app that needs to perform well and I would like to run it on Linux. It is a console app with no graphics. Any suggestions would be greatly appreciated ... Andy -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Display an image
--- Yuet Sim Lee <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I knew that getImage() could
> load an image file from the
> network and paint() could
> display it.
>
> However, I don't know how can I
> get an image which is a local
> file. I tried
>
> Image i = getImage( String filename )
>
> It can not be compiled and the
> compiler said:
>
>
> Incompatible type for method. Can't convert
> java.lang.String to java.net.URL.
> i = getImage("houses.gif");
>
The format of getImage is getImage(URL) so you need to
say getImage(new URL("houses.gif")).
Ken
_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Display an image
Make sure you are using the getImage() from the Toolkit class and not the Applet
class. The Applet class only supports getImage() for a URL. I couple things to
try:
i = getToolkit().getImage( "houses.gif" );
-- or --
i = getImage( new URL( "file:////houses.gif" ));
Andy
Yuet Sim Lee wrote:
> Hi,
>
> I knew that getImage() could
> load an image file from the
> network and paint() could
> display it.
>
> However, I don't know how can I
> get an image which is a local
> file. I tried
>
> Image i = getImage( String filename )
>
> It can not be compiled and the
> compiler said:
>
> Incompatible type for method. Can't convert java.lang.String to java.net.URL.
> i = getImage("houses.gif");
>
> --Simmy
>
> --
> Yuet Sim Lee
>
> --
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
RE: Calling Java objects from C++
>> >> Hi, >> >> I'm looking for a way to call Java objects from C++. >> Is this possible using JNI? > >Yes, it is possible. There are two scenarios: >1. you want to call methods of Java objects while you are in C++ code >that is the native implementation of a method of another Java object. In >this case, you have to pass the object you want to call methods upon as >a parameter to the native method. >2. you want to execute Java code while you are in unrelated C++ code. >Then, you have to create an instance of the Java virtual machine to >execute the code in. This is much like calling 'java classname' from the >command line. >For details look at the JNI documentation - it's difficult to summarize. > Thanks for the info. I would like to write a C++ container program which hosts java server objects. Therefore the second choice has to be considered. But having to create JVM in C++ container may cause performance issue. Maybe I should rather write the whole stuff in Java. I will look at JNI spec. Thanks, Naoki -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Compile OK but not Run
tinland wrote: > After an installation de jdk1.2 on Linux RedHat 6 > > I can Compile with javac in Xterm windows and i get one file.class > > When i would run this file.class i use "java file.class" and it return this error : > at java.lang.NoClassDefFoundError. > No, no , no. you must call java with a class name not a class file for example if your class is named file and resides on file.java after compilation you effectively have file.class then you must tell the interpreter java file (note that as the Java Language is case sensitive you must name the class in le line command with the right case.) also note that the CLASSPATH enviroment variable must point tu the current directory CLASSPATH=.:$JAVA_HOME/lib:(whatever classes you want to point to) Good Luck! > > Could you help me > > Thanks > > Olivier TINLAND > French > > -- > To UNSUBSCRIBE, email to [EMAIL PROTECTED] > with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED] -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Display an image
Yuet Sim Lee wrote:
> Hi,
>
> I knew that getImage() could
> load an image file from the
> network and paint() could
> display it.
>
> However, I don't know how can I
> get an image which is a local
> file. I tried
>
> Image i = getImage( String filename )
>
> It can not be compiled and the
> compiler said:
>
> Incompatible type for method. Can't convert java.lang.String to java.net.URL.
> i = getImage("houses.gif");
>
Check the Java tutorial java.sun.com go to documentation->tutorial
And check the section Using images essentially the things work like this
>From the Java tutorial:
Using the getImage Methods
This section discusses first the Toolkit getImage methods and then the
Applet getImage methods.
The Toolkit class declares two getImage methods:
Image getImage(URL url)
Image getImage(String filename)
Here are examples of using the Toolkit getImage methods. Although every Java
application and applet can use these methods, applets are subject to the usual
security
restrictions. In particular, untrusted applets can't successfully specify a
filename to getImage because untrusted applets can't load data from the local
file system. You can
find information about restrictions on untrusted applets in Security
Restrictions.
Toolkit toolkit = Toolkit.getDefaultToolkit();
Image image1 = toolkit.getImage("imageFile.gif");
Image image2 = toolkit.getImage(
new URL("http://java.sun.com/graphics/people.gif"));
Good Luck!
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
announce: TYA 1.4 new release
Hi, the new TYA JIT release 1.4 is out there!! I've just uploaded 135200 bytes to ftp://gonzalez.cyberus.ca/pub/Linux/java/tya14.tgz What's new? This is pasted from README: --quote-- .. 3. SOME RELEASE NOTES = This release should show some general good speedup (5..20%) compared with previous TYA release. Some benchmarks show that TYA is still slower than sunwjit, but some other benchmarks like LINPACK or SCIMARK show that TYA can be _faster_ than sunwjit, at least on my P200. Also for some application usage like ``javac Sieve.java'' TYA here is faster than sunwjit. I've added some new approaches to TYA, for details (WHAT's NEW) look into the Changelog file. . --end quote-- Note for our newbies only: What's TYA..? TYA was the first Java JIT compiler for Linux, designed as add on to blackdown's JDK ports. Later I've ported TYA to run under FreeBSD too. The original TYA tgz-archive is released in source code only and of course under GPL license. As usual: NO secrets and NO traps. Compile & install is very easy, please read README file. BTW, TYA JIT is developed just_for_fun as a hobby only. So enjoy! Any feedback very welcome. Albrecht PS: also I've fixed some JNI problems. PPS: web masters, please update some of your outdated TYA links. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Display image
Is it possible that Java display an pgm/raw formatted image? --Simmy -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Need help in Compiling with JDK 1.2
> Hi,I downloaded JDK 1.2 (jdk1_2pre-v2) for Linux from www.blackdown.org. > After installed it on Redhat 5.2 in /usr/local > directory, when I tried to test compiling it: > javac hello.java > > I got the following errors: > /usr/local/jdk1.2/bin/i386/native_threads/javac: error in loading > shared libraries > > libhpi.so: cannot open shared object file: No such file or directory This most probably means that you have downloaded the wrong archive, i.e., the glibc2.1 distribution on a glibc2.0 system. CU, Stefan -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Need help in Compiling with JDK 1.2
Tony T wrote: > > Hi,I downloaded JDK 1.2 (jdk1_2pre-v2) for Linux from www.blackdown.org. > After installed it on Redhat 5.2 in /usr/local > directory, when I tried to test compiling it: > javac hello.java > > I got the following errors: > /usr/local/jdk1.2/bin/i386/native_threads/javac: error in loading > shared libraries > > libhpi.so: cannot open shared object file: No such file or directory You're on RH5.2, so presumably running a glibc2.0 system. Did you download the JDK for glibc2.0? Nathan -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: Display image
> Is it possible that Java display an pgm/raw formatted > image? JAI will support PGM raw. For more information about JAI see http://java.sun.com/products/java-media/jai/index.html. A pure-Java implementation is available from that site. A native code enhanced version will be ported to Linux, for the current status of the port see http://www.blackdown.org/java-linux/jdk1.2-status/jai-status.html. CU, Stefan -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
