Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Create Java app on QNX 6.30/6.32: (10 Items)
   
Create Java app on QNX 6.30/6.32  
Hello,

I'd like to develop a little java app with swt on nto.
Everything works fine on win32 of course.
Now I need to know how to make it work on nto.
I've downloaded and unzip eclipse-SDK-2.1-qnx-photon.zip, I suppose it should allow me to create JAva projects, but I 
suppose I have to manually declare the feature to Eclipse.  Don't know how to do-

Then I've installed libswt-photon-3019.so, don't really know if it's the latest version...

Anyway, what to do now to create and run Java project?

Kind regards,
Re: Create Java app on QNX 6.30/6.32  
Hi,

I've just found the swt-3.4-photon-qnx-x86.zip and how to use it.

I think I just have to know what to do to be able to create a Java project on Eclipse nto.

Do I have to install J9 on 6.3.0?

Regards,
Re: Create Java app on QNX 6.30/6.32  
To get support for Java in IDE, go to update site. Windows->Software Updates->Find and Install
pick new feature to install
it will who Update site, select and click next. It should should features including Java SDK. 
It is what you need to install.

No to run it you need java vm. If you have full momentics installed on the target you have pvm - vm is used to run 
eclipse on qnx, you can use it instead of J9. I cannot run java programs remotely using QNX IDE,
you whould have to transfer files (using file navigator) on target and run pvm with options from command line. 
Re: Create Java app on QNX 6.30/6.32  
Great Elena,

I try that, thanks a lot.
Re: Create Java app on QNX 6.30/6.32  
Hello,

As Eclipse nto really don't want to do anything when I select Software Updates->Find and Install, I have to develop on 
Eclipse Win32.

And As Eclipse doesn't exist anymore in 6.4.0, I have no choice than to decide to develop on Win32.

Well, I finally got it working via Run as... swt application on Eclipse 4.01 win32.

Now, could you tell me do I need to run it on nto with pvm?
I've just installed the libswtphotonxxx.so.

Sorry but I'm really a newbie on java developments.

Regards,

Re: Create Java app on QNX 6.30/6.32  
I though you where talking about 6.3.2. Pvm does not exists on 6.4 because we don't ship IDE on 6.4.
If you still want to use 6.4: (the thing I saying now it totally not supported)
- Download qnx-photon ide package from http://community.qnx.com/sf/go/projects.ide/frs.ide_integration_builds.
ide_tau_20080717
- Unzip it on neutrino box in let say /tmp/ide4.5
- You would have pvm installed in /tmp/ide4.5/eclipse/jre/bin/pwm
To run let say hello word program (not swt) transfer .class file on target for example in /tmp/Hello.class.
To run it type
/tmp/ide4.5/eclipse/jre/bin/pwm -c /tmp Hello
(-c is same as -classpath in normal VMs)

To run with swt find out what is exact command line to run on windows, use same command on neutrino but replace java to 
pvm, -classpath to -c and
all path to paths to swt where eclipse is installed on neutrino.

Alain Bonnefoy wrote:
> Hello,
> 
> As Eclipse nto really don't want to do anything when I select Software Updates->Find and Install, I have to develop on
 Eclipse Win32.
> 
> And As Eclipse doesn't exist anymore in 6.4.0, I have no choice than to decide to develop on Win32.
> 
> Well, I finally got it working via Run as... swt application on Eclipse 4.01 win32.
> 
> Now, could you tell me do I need to run it on nto with pvm?
> I've just installed the libswtphotonxxx.so.
> 
> Sorry but I'm really a newbie on java developments.
> 
> Regards,
> 
> 
> 
> _______________________________________________
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post20004
> 
Re: Create Java app on QNX 6.30/6.32  
So for swt would be

cd /tmp/ide4.5/eclipse

./jre/bin/pvm -c /tmp:plugins/org.eclipse.swt.photon.qnx.x86_3.3.1.v3349.jar:plugins/org.eclipse.swt_3.3.2.v3347.jar  
Snippet245


(assuming class Snippet245 in the /tmp)

Also note that default eclipse java compiler produces class file that pwm does not understand.
To run this I had to change java compliance level to 1.3. 
Re: Create Java app on QNX 6.30/6.32  
hum well, I think it doesn't find swt correctly.
I just created a link from pvm to java to launch the following command:

bash-2.05a# /usr/bin/java -c /usr/qnx632/host/qnx6/x86/usr/qde/eclipse/plugins/org.eclipse.swt.photon.qnx.x86_3.2.1.
v3236.jar:/usr/qnx632/host/qnx6/x86/usr/qde/eclipse/plugins/org.eclipse.swt_3.2.2.v3236b.jar: bobine.java

But I get the following error:

Exception in thread "main" java.lang.ClassNotFoundException: bobine.java
        at java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; [compiled]
        at java.lang.ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class; [compiled]
        at java.lang.ClassLoader.findClassUsingLoader(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/Class; 
[compiled]
        at java.lang.Class.forName0(Ljava/lang/String;ZLjava/lang/ClassLoader;Z)Ljava/lang/Class; [native]
        at java.lang.Class.forNameNoCheck(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/Class; [compiled]

any idea?
Re: Create Java app on QNX 6.30/6.32  
Did you try to run your source code "bobine.java"? If yes you should compile your source code and run the "bobine.class"
 file. Make sure you only specify the name of the class file not including the file extension.

Also please add your current working directory to your classpath - add a "." to the end of the class path.
Re: Create Java app on QNX 6.30/6.32  
You cannot run it like this. Did you ever run java from command line?
You have to specify path to precompiled classes. And as anargument you have to specify fully qualified (with package 
name if any) name of the class.
See my previous post.

Alain Bonnefoy wrote:
> hum well, I think it doesn't find swt correctly.
> I just created a link from pvm to java to launch the following command:
> 
> bash-2.05a# /usr/bin/java -c /usr/qnx632/host/qnx6/x86/usr/qde/eclipse/plugins/org.eclipse.swt.photon.qnx.x86_3.2.1.
v3236.jar:/usr/qnx632/host/qnx6/x86/usr/qde/eclipse/plugins/org.eclipse.swt_3.2.2.v3236b.jar: bobine.java
> 
> But I get the following error:
> 
> Exception in thread "main" java.lang.ClassNotFoundException: bobine.java
>         at java.lang.ClassLoader.loadClass(Ljava/lang/String;Z)Ljava/lang/Class; [compiled]
>         at java.lang.ClassLoader.loadClass(Ljava/lang/String;)Ljava/lang/Class; [compiled]
>         at java.lang.ClassLoader.findClassUsingLoader(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/Class; 
[compiled]
>         at java.lang.Class.forName0(Ljava/lang/String;ZLjava/lang/ClassLoader;Z)Ljava/lang/Class; [native]
>         at java.lang.Class.forNameNoCheck(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/Class; [compiled]
> 
> any idea?
> 
> _______________________________________________
> QNX Momentics Community Support
> http://community.qnx.com/sf/go/post20186
>