Author Topic: How To Start A .jar File From The Command Line?  (Read 30328 times)

ludo

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
How To Start A .jar File From The Command Line?
« on: January 02, 2006, 03:38:48 am »
I am diving into the Personal Profile world, aided by some docs. But I need some help, because I'm only 1 week old in Java (Personal Java even younger)

http://developers.sun.com/techtopics/mobil...cles/ztutorial/
The  release notes of J2ME Personal Profile for Zaurus
and http://java.sun.com/j2me/docs/pdf/PP_Programmer_Guide.pdf

In order to really understand what is inside an .ipk package containing a Java application, I want to launch the file manually using the command line.

I have installed  the J2ME Personal Profile for Zaurus Version 1.0, Early Access Release (from sun web site).

In the programmer guide it is mentionned that to launch a .jar file, I should use the following command:
Code: [Select]
cvm [-Djava.class.path=classpath] className

But my file is a .jar

When running cvm from the directory where my .jar file is, I have tried:
Code: [Select]
cvm -Djava.class.path=. MyApplication.jar MyApplication
As well as
Code: [Select]
cvm -Djava.class.path=. -jar MyApplication.jar MyApplication
and
Code: [Select]
cvm -jar MyApplication.jar MyApplication

But none will work.

The application is the dictionary babbletower, that I've got working following Meanie's indication and a little reading on his web site (see thread https://www.oesf.org/forums/index.php?showtopic=10160)

So can I run a .jar file if I don't have .class file? It's fine on my PC with the command
Code: [Select]
java -jar MyApplication.jar MyApplication
But not with cvm. What am I missing here?  Do I need to create classes to be able to run the .jar file?

Thanks for any help

Ludo
C3000 sharp ROM

tml

  • Full Member
  • ***
  • Posts: 105
    • View Profile
How To Start A .jar File From The Command Line?
« Reply #1 on: January 02, 2006, 06:54:40 am »
I haven't used cvm for some time now, but: are you sure that cvm has a -jar command line option? If not, you might try to add the jar to the classpath and pass the main class as argument.
SL-C3100

ludo

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
How To Start A .jar File From The Command Line?
« Reply #2 on: January 02, 2006, 06:41:43 pm »
Yes it does: if you type cvm without any option, it will tell you as a help what are the available options.
There is a -jar option.

Do you know what I should write then?
C3000 sharp ROM

ludo

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
How To Start A .jar File From The Command Line?
« Reply #3 on: January 03, 2006, 03:25:03 am »
Ok I found out:

Code: [Select]
cvm -XappName=$0 -Djava.class.path= ./MyApps.jar MyApps

But I have the messages:


Code: [Select]
SlSharedManager: can't get proc entry
Could not open translation file /home/QtPalmtop//i18n/ja/libs1.qmid


Do you know what it relates to?

Ludo (doing some progresses in java and personal profile!!)
C3000 sharp ROM

rrashkin

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
    • http://pwp.t-3.cc/rrashkin
How To Start A .jar File From The Command Line?
« Reply #4 on: February 08, 2006, 12:01:16 pm »
I use the following:
Code: [Select]
evm -cp jSolun100c.jar jSolun.JSolun
in this case for the JSolun star guide program.
Bob Rashkin
rrashkin@csc.com
SL5500/Sharp3.1
Targus IR keyboard

eMWe

  • Newbie
  • *
  • Posts: 5
    • View Profile
How To Start A .jar File From The Command Line?
« Reply #5 on: September 06, 2006, 11:09:15 am »
Hi, Bob,

I'm just fighting with Solun (120b) to get it working on my poodle.
(Sorry, I'm a real linux-novice!!)

Have tried your command line, but got only:
"java.lang.NoClassDefFoundError: JSolun/JSolun"

Any idea what's going wrong there?

I'm running Zynergy Rom and jeode 1.1.7 on my poodle...

Martin

Trevoke

  • Newbie
  • *
  • Posts: 3
    • View Profile
How To Start A .jar File From The Command Line?
« Reply #6 on: September 06, 2006, 01:41:34 pm »
#!/bin/bash
$QPEDIR/bin/evm -XappName=$0 -cp /home/QtPalmtop/java/Jago/Jago.jar Go

Take what you need from this.. I don't exactly know what it's saying. It's a bash script to run Jago.jar.