Will JNI do this?

2001-02-06 Thread soonho




Hi,
 
I have a program of networking, which will 
implement Mobile Internet Protocol.
This program in in C and run in Linux. 

 
Now we plan to create a Java GUI to show the 
operation of this program.
 
Does JNI able to do this? By using JNI (Java 
invokes C) or Innovation API (C invokes Java)?
 
We dont want to use runtime for this 
project.
 
If using C to invokes Java, Could we create JVM 
inside the program (C code) and ask this program to run Java 
GUI.
 
If uisng Java invokes C, we unable to change the 
main(int argc, char *argv) to JNIEXPORT int JNICALL ...
how to solve this problem?
 
Thank you
soonho


Blackdown FCS 1.3 AWT KeyEvents are wrong

2001-02-06 Thread Peter Pilgrim



I have found a problem in Blackdown J2SE1.3 FCS that
I think affect all SUN Core base releases. I have noticed that KeyEvent
are sometimes not reported properly in the Humanoid Game I developed
a while back. (www.xenonsoft.demon.co.uk/humanoid/humanoid.html)
Whilst looking at the development tree of this game with J2SE I found
that the key event queue system was buggy.

The games uses the following keys by default although this is customizable

[A] up
[Z] down
[S] irrevelant
 [Space] reverse direction of the starship
[Shift] thrust the starship
[Return] fire laser
[H] irrevelant

[Shift] is used for thrusting a spaceship that you see in AWT window.
Consequently shift held down a low.  The problem is that the Blackdown
impl'n does not report key event when the SHIFT KEY is released and
sometime in combination with another key that relased.
 It seems to be missing KEY releases a lot which I rely in my game.

Basically I have IBM JDK 1.3 as my default and found no problems with
this JDK version

Only when I switched Blackdown I found this problems.

We know that Blackdown does share CVS tree with Sun release so this bug
if fixed in the blackdown will propogate back to Sun code base.

You can download the game and compile for yourself. There is a small
executable `Landscape' which you can use see the bug yourself

Here is some cut down code anyway

protected class GameKeyListener implements KeyListener
{
 public GameKeyListener()
 {
 // System.out.println("GameKeyListener() *DEBUG*.");
 }

 // Handle Event Driven Input
 public void keyTyped( KeyEvent ke )
 {
 }

 public void keyPressed( KeyEvent ke )
 {
 int keycode = ke.getKeyCode();
 int mods = ke.getModifiers();

 if ( keycode == KEYCODE_UP )
  up_key_pressed = true;
 else if ( keycode == KEYCODE_DOWN )
  down_key_pressed = true;
 else if ( keycode == KEYCODE_THRUST )
  thrust_key_pressed = true;
 else if ( keycode == KEYCODE_LASER )
  fire_key_pressed = true;
 else if ( keycode == KEYCODE_COD )
  cod_key_pressed = true;
 else if ( keycode == KEYCODE_HYPERSPC )
  hyperspace_key_pressed = true;
 else if ( keycode == KEYCODE_SMARTBMB )
  smartbomb_key_pressed = true;

  ...

 // Special case of shift key
 if ( (mods & InputEvent.SHIFT_MASK ) != 0 )
  thrust_key_pressed = true;

 }

 public void keyReleased( KeyEvent ke )
 {
 int keycode = ke.getKeyCode();
 int mods = ke.getModifiers();

 if ( keycode == KEYCODE_UP )
  up_key_pressed = false;
 else if ( keycode == KEYCODE_DOWN )
  down_key_pressed = false;
 else if ( keycode == KEYCODE_THRUST )
  thrust_key_pressed = false;
 else if ( keycode == KEYCODE_LASER )
  fire_key_pressed = false;
 else if ( keycode == KEYCODE_COD )
  cod_key_pressed = false;
 else if ( keycode == KEYCODE_HYPERSPC )
  hyperspace_key_pressed = false;
 else if ( keycode == KEYCODE_SMARTBMB )
  smartbomb_key_pressed = false;
 else if ( keycode == KeyEvent.VK_L &&
(mods & InputEvent.CTRL_MASK) != 0 ) {
  level_key_pressed = false;
 }

  ...

 }

}
--
Peter Pilgrim
G.O.A.T
"the Greatest Of All Time"



--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




setting up java for debian 2.1

2001-02-06 Thread Sean Choi

Can someone help me get Java 2 to run on a Debian 2.1
system installed onto a Dell pentium II 350 Mhz
processor. I will go into details of the steps I took
and the results I got.

all steps done as root user
1. created directory /usr/local/sun/
2. unpack jdk1.3 from blackdown.org or sun ( can't
remember, i think they should be the same)

3. modified the .bashrc file and also the /etc/profile
file to include the environment variables
export JAVA_HOME="/usr/local/sun/jdk1.3"
export PATH="$PATH:JAVA_HOME/bin"
export CLASSPATH=".:$JAVA_HOME/lib:$JAVA_HOME/jre/lib"
export JAVA_COMPILER=javacomp

4. executed the following at the command prompt
%install /usr/bin/javac
/usr/local/sun/jdk1.3/bin/javac
%install /usr/bin/java /usr/local/sun/jdk1.3/bin/java

5. rebooted linux system

6. login as root user
7. sourced the .bashrc file
8. tried to execute java-version at command prompt
%java - version
got following messge
error - can't find libjava.so

9. also tried
%/usr/local/sun/jdk1.3/bin/java -version
got the follwing message

/usr/local/sun/jdk1.3/bin/java: /bin/realpath: No such
file or directory
/usr/local/sun/jdk1.3/bin/java: /bin/realpath: No such
file or directory
grep: /lib/jvm.cfg: No such file or directory
grep: /lib/jvm.cfg: No such file or directory
/usr/local/sun/jdk1.3/bin/java: /bin/realpath: No such
file or directory
java was not found in /bin/i386/native_threads/java
DEBIANSEAN:~#

Anyone know what I'm doing wrong? I would appreciate
any help.

Sean

__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: setting up java for debian 2.1

2001-02-06 Thread Juergen Kreileder

> "Sean" == Sean Choi <[EMAIL PROTECTED]> writes:

Sean> Can someone help me get Java 2 to run on a Debian 2.1 system
Sean> installed onto a Dell pentium II 350 Mhz processor. I will
Sean> go into details of the steps I took and the results I got.

The easiest way is to install our j2sdk1.3 .deb package.  If you
want to use apt to install it, you have to add a line of the form
"deb ftp:debian  non-free"
to /etc/apt/sources.list.   should be potato or woody.

[...]

Sean> /usr/local/sun/jdk1.3/bin/java: /bin/realpath: No such
Sean> file or directory
Sean> /usr/local/sun/jdk1.3/bin/java: /bin/realpath: No such
Sean> file or directory
Sean> grep: /lib/jvm.cfg: No such file or directory
Sean> grep: /lib/jvm.cfg: No such file or directory
Sean> /usr/local/sun/jdk1.3/bin/java: /bin/realpath: No such
Sean> file or directory
Sean> java was not found in /bin/i386/native_threads/java
Sean> DEBIANSEAN:~#

Looks like your glibc is too old, you need glibc-2.1.3 or newer.  The
j2sdk1.3 .deb package will take care of this and other dependencies.


Juergen

-- 
Juergen Kreileder, Blackdown Java-Linux Team
http://www.blackdown.org/java-linux.html
JVM'01: http://www.usenix.org/events/jvm01/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: setting up java for debian 2.1

2001-02-06 Thread Sean Choi

How do I know if I have Potato or Woody? I'm assuming
Woody because I have Debian 2.1 but I really don't
know.

Also, I only need to download one package from the
blackdown.org site correct, and this .deb package file
will have the updates for my glibc? I'm new to Debian,
and was thinking of downloading the one jsdk .deb file
and installing it by typing
ar x packagefile.deb

Can you tell me if I am correct or do I need to use
apt if I have an old glibc?

I have only a 28k modem, so I prefer the most
appropriate solution. I was thinking of doing the
download from a friends computer and burning the file
onto a cd.

Thank you for the help
Sean



--- Juergen Kreileder <[EMAIL PROTECTED]> wrote:
> > "Sean" == Sean Choi <[EMAIL PROTECTED]>
> writes:
> 
> Sean> Can someone help me get Java 2 to run on a
> Debian 2.1 system
> Sean> installed onto a Dell pentium II 350 Mhz
> processor. I will
> Sean> go into details of the steps I took and
> the results I got.
> 
> The easiest way is to install our j2sdk1.3 .deb
> package.  If you
> want to use apt to install it, you have to add a
> line of the form
> "deb ftp:debian
>  non-free"
> to /etc/apt/sources.list.   should be potato
> or woody.
> 
> [...]
> 
> Sean> /usr/local/sun/jdk1.3/bin/java:
> /bin/realpath: No such
> Sean> file or directory
> Sean> /usr/local/sun/jdk1.3/bin/java:
> /bin/realpath: No such
> Sean> file or directory
> Sean> grep: /lib/jvm.cfg: No such file or
> directory
> Sean> grep: /lib/jvm.cfg: No such file or
> directory
> Sean> /usr/local/sun/jdk1.3/bin/java:
> /bin/realpath: No such
> Sean> file or directory
> Sean> java was not found in
> /bin/i386/native_threads/java
> Sean> DEBIANSEAN:~#
> 
> Looks like your glibc is too old, you need
> glibc-2.1.3 or newer.  The
> j2sdk1.3 .deb package will take care of this and
> other dependencies.
> 
> 
> Juergen
> 
> -- 
> Juergen Kreileder, Blackdown Java-Linux Team
> http://www.blackdown.org/java-linux.html
> JVM'01: http://www.usenix.org/events/jvm01/


__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]




Re: setting up java for debian 2.1

2001-02-06 Thread Benjamin Pharr

At 04:50 PM 2/6/01 , you wrote:
>Can someone help me get Java 2 to run on a Debian 2.1
>system installed onto a Dell pentium II 350 Mhz
>processor. I will go into details of the steps I took
>and the results I got.


The Blackdown guys put out a .deb file as well.  Just download it and do a 
"dpkg -i packagename".

Ben Pharr
[EMAIL PROTECTED]
-


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]