maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   JAVA on the N900 is possible! (https://talk.maemo.org/showthread.php?t=37405)

elliotshepherd 2010-01-06 07:09

Re: JAVA on the N900 is possible!
 
Wow.

WOW.

As a java developer, I'm suddenly far more excited by my N900 (which i admit had been pissing me off a bit :).

http://learnnowbiz.com/elliot/Screen...106-180622.png

It's slow... but that doesn't matter. This is a desktop java swing app (frostwire) running on my phone. Without any changes.

(though a few bugs... it doesn't seem to take control on the keyboard... so typing anywhere brings up the contact list search!)

I think perhaps ill get jetty running, and write myself a web app to remote control my phone! (send/receive sms... take a picture... get the gps location... wipe the disk... etc)

Fun =)

HtheB 2010-01-08 13:32

Re: JAVA on the N900 is possible!
 
how about porting pspkvm to N900?

pspkvm is a JavaME emulator for the PSP.

Link:
http://sourceforge.net/apps/trac/pspkvm

rlinfati 2010-01-08 14:02

Re: JAVA on the N900 is possible!
 
psp over javeme over microemulator over javase over maemo ?

HtheB 2010-01-08 14:16

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by rlinfati (Post 459173)
psp over javeme over microemulator over javase over maemo ?

O_o???? hmmm???

modeless 2010-01-08 20:55

Re: JAVA on the N900 is possible!
 
Has anyone tried out the optimized OpenJDK for ARM on the N900 provided by Cambridge Software Labs (see http://www.camswl.com/openjdk/)? Would be interesting to hear whether it's running and how the performance is. Unfortunately I do not have a N900 yet to test it myself.

qole 2010-01-08 22:59

Re: JAVA on the N900 is possible!
 
rlinfati:

HtheB is suggesting a pspkvm port as a replacement for Microemulator on JavaSE.

pspkvm is itself a port of the PhoneME software. Porting directly from PhoneME to Maemo is probably a better bet, rather than going from pspkvm.

But this is a good idea, actually....

It looks like the current version of PhoneME Feature, MR4, isn't available for Linux/ARM, you'd have to try building it yourself from source.

The only Linux/ARM binaries I could find for this are an MR2 build from 2007, which is really really old (N800 days).

I think someone should try to build the Feature MR4 software from source (or from the source repo) using this guide.

It sure would be "cleaner" to get PhoneME working rather than using Microemulator on top of JavaSE.

Olle 2010-01-10 13:00

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by modeless (Post 460033)
Has anyone tried out the optimized OpenJDK for ARM on the N900 provided by Cambridge Software Labs (see http://www.camswl.com/openjdk/)? Would be interesting to hear whether it's running and how the performance is. Unfortunately I do not have a N900 yet to test it myself.

I've tested them and they work,
tested it with the tripleA-Client but dont know if there is a performance boost to the embedded Java from sun. need more testing

but one improvement will be the license issue

qole 2010-01-10 20:15

Re: JAVA on the N900 is possible!
 
I agree with Olle, the Cambridge binaries work somewhat, but they aren't nearly as polished or complete as the Sun binaries. But that's been my experience with OpenJDK vs. Sun Java on all platforms.

CormacB 2010-01-11 10:16

Re: JAVA on the N900 is possible!
 
Any chance of a rehost of the microemulator deb? I got the jre and microemu installed myself, but launching it from the command line is a pain. Also do you have a device config that fits the screen properly?

Olle 2010-01-11 10:48

Re: JAVA on the N900 is possible!
 
You can build your own Shortcut
HowTo is here

€ somewher is explaind where you can hide the stausbar in xTerminal
combined in a script it should work

a-rohde 2010-01-11 10:58

Re: JAVA on the N900 is possible!
 
Got it to work too. Thank's DAK for the nice instructions.

Now I have one question which i don't know should be solved in java or linux. Most of my Swing GUI's are created in horisontal mode, but when I launch them on the phone offcourse they will be launched in landscape and become scaled in the wrong way.

Doe's anyone know how to rotate the app 90 degrees, still making the buttons and so work?

shep 2010-01-12 10:31

Re: JAVA on the N900 is possible!
 
Thanks for the great work everyone.

I have copied the ejre-1_6_0_10-ea-b39-linux-armv6-vfp-eabi-headless-eval-30_jul_2009.tar.gz file to my N900, then I followed the instructions to extract it.

sudo gainroot
mkdir /home/opt/java
cd /opt/opt
tar xzf /home/user/MyDocs/*.tar.gz

Then I typed
ln -s /home/opt/java/ejre1.6.0_10/bin/java /usr/local/bin/java

I edited my /etc/profile and added the :/usr/local/bin to the export PATH= line.

When I go into XTERM without doing sudo gainroot now and type java I get an error "Java SE Embedded Evaluation Version Initialization Error...try again as root". But, when I sudo gainroot and type java I get the message "/bin/sh: java: not found"

Any ideas?


Also...on the J2ME front, I downloaded the javame_0.1-1_armel.deb file today and tried to install it, but Red Pill Mode is gone from the fireware now! Anyone know how I install a .deb file without Red Pill mode?


Thanks,

Shep

mankir 2010-01-12 10:40

Re: JAVA on the N900 is possible!
 
Eval-Version is useable for half a year or 5 months, i guess!

beli 2010-01-12 11:25

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by shep (Post 465991)
Thanks for the great work everyone.

I have copied the ejre-1_6_0_10-ea-b39-linux-armv6-vfp-eabi-headless-eval-30_jul_2009.tar.gz file to my N900, then I followed the instructions to extract it.

sudo gainroot
mkdir /home/opt/java
cd /opt/opt
tar xzf /home/user/MyDocs/*.tar.gz

Then I typed
ln -s /home/opt/java/ejre1.6.0_10/bin/java /usr/local/bin/java

I edited my /etc/profile and added the :/usr/local/bin to the export PATH= line.

When I go into XTERM without doing sudo gainroot now and type java I get an error "Java SE Embedded Evaluation Version Initialization Error...try again as root". But, when I sudo gainroot and type java I get the message "/bin/sh: java: not found"

Any ideas?


Also...on the J2ME front, I downloaded the javame_0.1-1_armel.deb file today and tried to install it, but Red Pill Mode is gone from the fireware now! Anyone know how I install a .deb file without Red Pill mode?


Thanks,

Shep

Quite logical: you exported the /usr/local/bin/ folder for the default user, but not for the root ...

You could run it as root by typing the full path instead of just 'java'

Another option is to make the default user owner of the ejre directory, then the user has all permissions. You can do this by the command
chown -R user:users /home/opt/java/ejre1.6.0_10

Hope this helps

sxg75 2010-01-12 11:42

Re: JAVA on the N900 is possible!
 
Question to the posted .deb file above - when there's JSE why would someone need MicroEmulator from that package as well? Thanks in advance!

Olle 2010-01-12 11:46

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by shep (Post 465991)
Also...on the J2ME front, I downloaded the javame_0.1-1_armel.deb file today and tried to install it, but Red Pill Mode is gone from the fireware now! Anyone know how I install a .deb file without Red Pill mode?

in terminal under root
with dpkg -i javame_0.1-1_armel.deb

and look what $PATH displays under user and root

€ @beli
the /etc/profile-file should work as root&user

shep 2010-01-12 12:03

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by sxg75 (Post 466085)
Question to the posted .deb file above - when there's JSE why would someone need MicroEmulator from that package as well? Thanks in advance!

I have some old J2ME apps that I had written that I want to continue using...didn't think they would work under the J2SE.

sevdali 2010-01-12 12:57

Re: JAVA on the N900 is possible!
 
I'm very excited to hear that Java (not j2ME) is working on N900.

My question is:

Why Nokia is not installing this officially to every N900?

It will be good for the marketing (which shows the power of n900 it is not a toy). It will be good for us (Java users and developers). Why should we try hacky ways to install it? Why should we fear that what will happen after 6 months of evaluation time?

If it is about money, I believe Sun (now Oracle) will license it less than $9.99 per device.

How can we let Nokia that we want Java in N900.

Any thoughts?

tomchiverton 2010-01-12 13:10

Re: JAVA on the N900 is possible!
 
Is there a bug and/or brainstorm for this ?

SubCore 2010-01-12 13:20

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by tomchiverton (Post 466220)
Is there a bug and/or brainstorm for this ?

yes, there are brainstorm proposals for Java ME / Java SE Runtimes for the N900.

they are linked to in this post.

shep 2010-01-12 15:24

Re: JAVA on the N900 is possible!
 
Hi All,

What a great community!

Thanks for the help everyone, I have both J2SE and the J2ME microemu working now.

My J2ME jars do not load under J2SE (expected), they do load under J2ME but I cannot seem to input data (especially numerals).

Any ideas?

I have shared the 3 jar & jad files in question here: http://workspace.office.live.com/?id...NNpXAAA&cid=40

Thanks,

Shep

qole 2010-01-12 17:33

Re: JAVA on the N900 is possible!
 
shep:

I think I have a similar problem with MicroEmu. I can start Opera Mini, but when I try to enter any kind of text (for example, to log into Facebook), I am given a text entry box. I can enter text into this box, but the OK in the lower right corner of the box doesn't do anything.

Now, if this isn't your problem, if it is that your keyboard input doesn't seem to work, try the keyboard input focus hack. When your app is on the screen, press the power button. When the menu pops up, press somewhere outside the menu so that it goes away. That usually works to give keyboard to the app.

shep 2010-01-12 21:41

Re: JAVA on the N900 is possible!
 
Hi Qole, I think I must be experiencing the same issues as you. I can type text (characters, never numbers) into text boxes, but button clicks and navigation menus are non-responsive.

I tried the hack you mentioned, but no luck.

Thanks for the suggestion.

Shep

Quote:

Originally Posted by qole (Post 466722)
I think I have a similar problem with MicroEmu. I can start Opera Mini, but when I try to enter any kind of text (for example, to log into Facebook), I am given a text entry box. I can enter text into this box, but the OK in the lower right corner of the box doesn't do anything.


gowen 2010-01-13 09:41

Re: JAVA on the N900 is possible!
 
I haven't tried this myself with Java on the N900, but for SDL based apps and some others to get numbers you have to hold the function key down while you press the number. Sorry if you've already tried this.

sxg75 2010-01-14 23:39

Re: JAVA on the N900 is possible!
 
Someone tried getting to run Dalvik VM on Java on top of Sun Java SE already?

Quote:

Currently supported functions

* Dalvik Execution file format (.dex)
* Complete Dalvik instruction set
* J2ME CLDC API
* Multi-thread (include synchronized block, wait and notify)

owerlord 2010-01-15 15:13

Re: JAVA on the N900 is possible!
 
can Runescape java based game be played with this? can anyone try to load the game up, no need to play it.

i would love to know if its possible =)

CormacB 2010-01-15 15:28

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by sxg75 (Post 472648)
Someone tried getting to run Dalvik VM on Java on top of Sun Java SE already?


Without the Android libraries ported to plain Java it is a bit pointless.

sjgadsby 2010-01-15 15:50

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by sevdali (Post 466198)
Why Nokia is not installing this officially to every N900?

Please also see comments #5 and #9 to bug #2695. Though the bug has been closed, you can still vote for it. Voting up a closed bug is a long shot to be sure, but it does appear to have some influence on occasion.

cipper 2010-01-15 15:55

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by Dak (Post 437152)
I too have DHCP and wifi....yet it doesn't work. I understand why it doesn't work and don't expect it to work. This is why I raised the warning flag about your suggestion - on most stock systems it likely won't work either.

There is more to your config....you really should explain what. DNS server? NIS? Funky WINS router etc?

on windows pc's usually works flawlessly, on linux depends on wether you have installed winbind or not:
apt-get install winbind

the winbind daemon is able to talk with the router and resolve the names.
It's Micro$oft technology, so it's usually not installed by default...

new_bee 2010-01-18 09:15

Re: JAVA on the N900 is possible!
 
hi there,
after downloading a few .jar apps in the ejre1.6.0_10/bin folder, when ever i run, "./java -jar *.jar" i m getting "Failed to load Main-Class manifest attribute from *.jar
can some one help me here.

beli 2010-01-18 13:19

Re: JAVA on the N900 is possible!
 
You have to launch one file instead of *.jar

"./java -jar foo.jar" with foo the name of the jar file you want to launch.

new_bee 2010-01-18 22:22

Re: JAVA on the N900 is possible!
 
yeh I just typed *.jar as an example. I am putting the complete file name there.

CormacB 2010-01-19 00:08

Re: JAVA on the N900 is possible!
 
Many java applications are not packaged as runnable jar files. You will need to run something like java -cp x.jar:y.jar com.company.program.MainClass

RE Runescape; the java plugin included in the embedded JRE doesn't seem to work with MicroB or Firefox, so there is no way to run applets on a webpage right now and that is how it runs. Possibly it might work out of appletviewer but I doubt it. Also I think Runescape uses OpenGL so there would be code changes required to use OpenGL ES as well as porting work for the JOGL library.

2bli2 2010-01-19 00:12

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by elliotshepherd (Post 455208)
I think perhaps ill get jetty running, and write myself a web app to remote control my phone! (send/receive sms... take a picture... get the gps location... wipe the disk... etc)

Got Jetty up and running myself yesterday (see below! :)) Not tried to do anything with it really though. Absolutely love this phone! :D

http://twitpic.com/show/full/yjssb
http://twitpic.com/show/full/yju8i

By the way, for the people struggling to get java executing after a sudo gainroot, you need to edit the gainroot script in /usr/sbin and add the appropriate PATH.

podgeandrodge 2010-01-24 09:17

Re: JAVA on the N900 is possible!
 
Hi guys, I just spotted this thread and thought someone might know something that could help me..


this is a link to a Jar file (J2ME Eagle Eyes) I used when setting up remote viewing of CCTV on the Nokia N95 - I presume these Jar files won't work on the N900 being a different system altogether?

Thanks for any help.

http://www.lakson.com.sg/cpcam/


But all I really want to do is get the N900 to play the streaming .mov file at my ip address - instead I just get a "mediaplayer" icon which, if i click it, tries to save the .mov file to the harddrive of the N900 instead of playing the live video...

floweih 2010-01-25 15:59

Re: JAVA on the N900 is possible!
 
Hello,

I installed the Sun Java Se for embedded like Dak described. I tried to run the application "Db Railnavigator" (can be downloaded here: http://persoenlicherfahrplan.bahn.de...=railnavigator ) but it did not work. The error-message was:

java -jar /home/user/MyDocs/javaprogramme/dbmidlet.jar
Failed to load Main-Class manifest attribute from
/home/user/MyDocs/javaprogramme/dbmidlet.jar
Nokia-N900-42-11:~#

Please can anybody help?

Greetings Bernd

wjbaird 2010-01-25 16:13

Re: JAVA on the N900 is possible!
 
@floweih

That's a midlet - so you need a J2ME (Java Mobile Edition) environment to run it in.

What is being discussed here is a J2SE (Java Standard Edition) environment.

I'm not sure what the status is on a J2ME environment for the N900.

CormacB 2010-01-25 18:03

Re: JAVA on the N900 is possible!
 
Quote:

Originally Posted by floweih (Post 493791)
java -jar /home/user/MyDocs/javaprogramme/dbmidlet.jar
Failed to load Main-Class manifest attribute from
/home/user/MyDocs/javaprogramme/dbmidlet.jar
Nokia-N900-42-11:~#

To run a midlet:
1. Install JRE
2. Go to http://www.microemu.org/ and download the zip file
3. Unzip the file
4. Go to folder in terminal and run java -jar microemulator.jar
5. Get out your stylus and used the menu to open dbmidlet.jar

You can also use the devices menu to select the resizable device which uses the screen a bit better. Unfortunately the "scale" option seems to be very slow.
I have peggle working for me, but with no sound.

fred123 2010-01-26 01:59

Re: JAVA on the N900 is possible!
 
Just downloaded JRE from sun licence says 90 day trial, hope there will be a better solution developed by then.

Ulrik 2010-01-26 13:59

Re: JAVA on the N900 is possible!
 
Is it possible to install Java on the N900 without the 90-day trial period?


All times are GMT. The time now is 15:22.

vBulletin® Version 3.8.8