LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-11-2010, 11:27 PM   #1
sumeet inani
Member
 
Registered: Oct 2008
Posts: 895
Blog Entries: 26

Rep: Reputation: 48
installing .jar application of mobile on computer


Hi I have dictionary.jar . If I save it in my mobile & open it then dictionary opens up with facility for entering word to search.
I saved that jar file in my PC & ran
$java -jar dictionary
OUTPUT
Failed to load Main-Class manifest attribute from
/data/dictionary.Java.jar

I am using ubuntu 8.04 with 'sun-java6-jre sun-java6-jdk sun-java6-plugin' installed.

I read http://java.sun.com/docs/books/tutor...ar/appman.html which says that application has entry point. I don't know java.

What do you suggest?
 
Old 03-11-2010, 11:31 PM   #2
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
Have you tried using ./filename.jar??
 
Old 03-11-2010, 11:48 PM   #3
sumeet inani
Member
 
Registered: Oct 2008
Posts: 895
Blog Entries: 26

Original Poster
Rep: Reputation: 48
Yes
$./Dictionary.Java.jar
bash: ./Dictionary.Java.jar: cannot execute binary file

Now what ?
 
Old 03-12-2010, 12:00 AM   #4
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
You need to have at least the Java Runtime Environment installed first.
 
Old 03-12-2010, 12:34 AM   #5
sumeet inani
Member
 
Registered: Oct 2008
Posts: 895
Blog Entries: 26

Original Poster
Rep: Reputation: 48
Quote:
I am using ubuntu 8.04 with 'sun-java6-jre sun-java6-jdk sun-java6-plugin' installed.
Actually I made file HelloWorld.java
Code:
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
and ran
$ javac HelloWorld.java
$ java HelloWorld
Hello, World!
$

Is anything else needed ?
 
Old 03-12-2010, 01:32 AM   #6
Galib
Member
 
Registered: Mar 2009
Location: $HOME
Distribution: Slackware64
Posts: 69

Rep: Reputation: 17
Do you have execute permissions for the jar file?
 
Old 03-12-2010, 03:06 AM   #7
sumeet inani
Member
 
Registered: Oct 2008
Posts: 895
Blog Entries: 26

Original Poster
Rep: Reputation: 48
#chmod 777 /data/Dictionary.Java.jar
$cd /data;./Dictionary.Java.jar
bash: ./Dictionary.Java.jar: cannot execute binary file
$

What should I do ?
 
Old 03-12-2010, 05:39 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
The command : java -version
.. will show, which version, you are using.

sudo update-alternatives --config java
.. will show the versions, you can choose between.
Please select "sun java", if not already enabled.


This command : ./Dictionary.Java.jar : is wrong.
java -jar Dictionary.Java.jar : is the valid command.
Though your mobile equipment may use some script instead,
a script, that includes other files ?

And may be the file depends on a special "mobile java" ?
.....
 
Old 03-12-2010, 05:45 AM   #9
sumeet inani
Member
 
Registered: Oct 2008
Posts: 895
Blog Entries: 26

Original Poster
Rep: Reputation: 48
So turns out the file is meant for mobile java as knudfl said.


for benefit of all i installed java in following mannner
#apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin
#update-java-alternatives -s java-6-sun
Make sure /usr/lib/jvm/java-6-sun is added to the top of JVM list in /etc/jvm
add to ~/.bash_profile
export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=$PATH:$JAVA_HOME/bin
After all this you can try simple program mentioned above to see your java is working well.

I thought the mobile phone applications can be run on computer which can even run video game ROM's via emulator. What say ?

Last edited by sumeet inani; 03-12-2010 at 05:48 AM.
 
Old 03-12-2010, 06:02 AM   #10
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 394

Rep: Reputation: 61
JavaSE is not the same as JavaME. You'd probably need some sort of JavaME emulator in order to run J2ME application jars on standard Java - at the very least the Sun Wireless Toolkit. But I don't really get your question or how this relates to emulators and ROMs.
 
Old 03-12-2010, 11:02 AM   #11
sumeet inani
Member
 
Registered: Oct 2008
Posts: 895
Blog Entries: 26

Original Poster
Rep: Reputation: 48
Sorry for my obscure words.
i just meant that the jar file runs fine on mobile.
Is there a way I can get it to run on PC ?
 
Old 03-12-2010, 11:46 AM   #12
arashi256
Member
 
Registered: Jan 2008
Location: Brighton, UK
Distribution: Ubuntu 12.04 / CentOS 6.5
Posts: 394

Rep: Reputation: 61
Quote:
Originally Posted by sumeet inani View Post
Sorry for my obscure words.
i just meant that the jar file runs fine on mobile.
Is there a way I can get it to run on PC ?
Like I said, if it runs fine on a mobile, it's a J2ME (JavaME these days) application. You need to get a J2ME emulator to run the program. I believe the Sun Wireless Toolkit has one - I certainly used it to test my mobile apps when I was doing mobile programming in Java.
 
Old 03-12-2010, 11:32 PM   #13
sumeet inani
Member
 
Registered: Oct 2008
Posts: 895
Blog Entries: 26

Original Poster
Rep: Reputation: 48
Okay . I downloaded sun_java_wireless_toolkit-2.5.2_01-linuxi486.bin.sh
Then made it executable. Ran it . Agreed to license.
Code:
No suitable Java interpreter was detected
This application requires Java 2 SDK, Standard Edition (1.5 or later). Enter a path to a Java 2 SDK (For example: /user/jdk1.5/bin). You can type "exit" to cancel installation.
Enter a path to the Java 2 SDK: /usr/bin
/usr/bin/java
Testing /usr/bin/java...

Please enter a directory into which you would like to install the Sun Java(TM) Wireless Toolkit, 2.5.2 for CLDC.
[ default is /home/lxuser/Desktop/WTK2.5.2 ]: /home/lxuser/Desktop/WTK2.5.2                 
Installation directory is /home/lxuser/Desktop/WTK2.5.2.
 $ /home/lxuser/Desktop/WTK2.5.2/bin/ktoolbar#Now running the software
OTA server emulation started ...
HTTPS server emulation started ...

(<unknown>:6130): Gtk-WARNING **: Attempting to add a widget with type GtkButton to a GtkComboBoxEntry (need an instance of GtkEntry or of a subclass)

(<unknown>:6130): Gtk-CRITICAL **: gtk_widget_realize: assertion `GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed

(<unknown>:6130): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:6130): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:6130): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed

(<unknown>:6130): Gtk-CRITICAL **: gtk_paint_box: assertion `style->depth == gdk_drawable_get_depth (window)' failed
09:52:05 ~/Desktop $ 
I want to know how to use this toolkit to run jar file on mobile & did I do anything wrong during installation ?

I got file from https://cds.sun.com/is-bin/INTERSHOP...tionTypeFilter where they have just told to run file.

Last edited by sumeet inani; 03-12-2010 at 11:33 PM.
 
Old 07-07-2010, 07:47 AM   #14
sumeet inani
Member
 
Registered: Oct 2008
Posts: 895
Blog Entries: 26

Original Poster
Rep: Reputation: 48
Long time , nobody told me what to do.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write a daemon Linux service to a Java application which execute a .jar haseit Linux - Newbie 2 10-14-2011 04:10 AM
Application for finding classfiles or packages inside jar archives ? wearetheborg Linux - Software 2 12-27-2009 05:32 AM
KDE jar MIME is application/zip and not application/java-archive in Ubuntu Intrepid? arobinson74 Linux - Software 2 09-18-2009 12:40 PM
how do i execute a jar (java application) in linux amolgupta Linux - Software 2 07-20-2006 06:55 AM
Permission Denied while installing new jar library for my new application lavinal Linux - Software 1 09-02-2004 05:47 AM


All times are GMT -5. The time now is 09:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration