Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Bat Deployment (Contd)

Posted on 2007-03-21
16
Medium Priority
?
225 Views
Last Modified: 2010-03-31
Hello,

This question is related to
http://www.experts-exchange.com/Programming/Languages/Java/Q_22454895.html

As recommended, I used izPack to deploy my application. Well, it works great, you can just double click on the jar file and it will *extract* the file for you. However, after extracting to the folder that user wants, the user needs to execute the java again by going to command prompt and typed in "java -jar blah blah". Then the question comes again. What would be the best idea to execute the java application?

Hence, in my opinion, izPack only helps you to create a *good* look-and-feel installer. If we can double click on the jar as izPack, why can't we double click on our custom jar file as well?

Any idea?

PS. I will get back on this by tomorrow.

Thanks
David
0
Comment
Question by:suprapto45
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 4
  • +1
16 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 18767248
If you deploy via Java Web Start, you will get a smoother experience
0
 
LVL 92

Assisted Solution

by:objects
objects earned 400 total points
ID: 18767331
What OS, Have you tried double clicking the jar
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 400 total points
ID: 18767349
Double-clicking will only work if there is a correct file association between jar and runtime
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 30

Expert Comment

by:Mayank S
ID: 18767471
Yes the platform should have the Java 2 Standard Edition (java.exe or javaw.exe) as the default opener for .jar files instead of something else like Winzip.
0
 
LVL 16

Author Comment

by:suprapto45
ID: 18768608
CEHJ, I agree with you about the Java WebStart but I just would like to straight things out about the izPack at this moment :). I like the idea of being able to double click the jar file - it is very friendly to the users.

objects, mayankeagle,
>>"What OS, Have you tried double clicking the jar"
I used Windows 2000. Well, one thing, izPack is to create installer in the form of jar where you can double click the jar file (installer). Then the installer will extract all the files out to the destination folder. That's all. I can't double click on my jar file that has been extracted out by izPack.

This is my scenario.
I have successfully created the installer with izPack. It extracts out my /lib/*.jar (third party jar) and the /main.jar (my main app jar). After user has extracted out this to (assuming) C:/Program Files/JavaProg/, the user needs to go to the command prompt, go to the C:/Program Files/JavaProg/ and execute the java command manually to run the application.

If izPack can create the double click Jar, can we do the same to our app?

Thanks and please let me know if my explanation is unclear.
David
0
 
LVL 30

Accepted Solution

by:
Mayank S earned 1200 total points
ID: 18768616
>> I can't double click on my jar file that has been extracted out by izPack.

You can if the OS is configured to start it using Java 2, if it contains a main class and a corresponding entry in the manifest.
0
 
LVL 16

Author Comment

by:suprapto45
ID: 18768629
Thanks mayankeagle,

>>"You can if the OS is configured to start it using Java 2, if it contains a main class and a corresponding entry in the manifest."
Not sure about this. Can you give me more idea about this? URL should be fine. Currently, when I double click on the my jar file, it says that it could not find the Main class.

Thanks
David
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18768655
Means that Java 2 should be defined as the default application to open JAR files. In Windows, goto Windows Explorer -> Tools -> Folder Options -> File Types.

>> when I double click on the my jar file, it says that it could not find the Main class.

That probably means that Java 2 is the default application already. You need to add the JAR file to the classpath or try putting it in %JAVA_HOME%\jre\lib\ext and then double click on it.
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 1200 total points
ID: 18768656
I assume you have a Main-Class attribute defined in the manifest.mf
0
 
LVL 16

Author Comment

by:suprapto45
ID: 18768694
Sorry,

I have a meeting. I should be back in the next few hours time.

Please feel free to post any comments.

David
0
 
LVL 16

Author Comment

by:suprapto45
ID: 18769214
>>"That probably means that Java 2 is the default application already. You need to add the JAR file to the classpath or try putting it in %JAVA_HOME%\jre\lib\ext and then double click on it."

Let me try that. So it means that user needs to set their classpath manually. Am I right?

David
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 18769249
Guess so.... otherwise it might be possible through some script....
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18769698
>>I like the idea of being able to double click the jar file - it is very friendly to the users.

Yes, but of course JWS can create a desktop shortcut.

As far as double-clicking your jar is concerned, have you done your manifest properly?
0
 
LVL 16

Author Comment

by:suprapto45
ID: 18769791
Okay,

The problem comes of the unsupportedClass. I compiled it using jdk 1.6 while try to double click the jar in the jre 1.5. However it still reports the problem as "could not find the Main class."

Well, I think that I am going to have another question on the jdk compatibility soon.

Thanks all for this.

David
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 18769794
Compile it to as low a target as possible for maximum portability
0
 
LVL 16

Author Comment

by:suprapto45
ID: 18769807
It is okay CEHJ,

please post it in new thread so anyone can get benefit by it.

http://www.experts-exchange.com/Programming/Languages/Java/Q_22465140.html
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question