Results 1 to 19 of 19
Thread: Java software
- 04-28-2010, 12:23 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 44
- Rep Power
- 0
- 04-28-2010, 12:49 PM #2
Senior Member
- Join Date
- Mar 2010
- Posts
- 266
- Rep Power
- 4
bad news - no, you cannot. good news - everybody already has Java anyway.
- 04-28-2010, 01:13 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
- 04-28-2010, 01:52 PM #4
Every one already has the JRE installed (well not every body, but 95%+ of the people, and the 5% that don't eather have computers so old that it can not run it, or removed it for reasons of their own, but the poeple you are focusing I would say 99.999% of them probably do have the JRE installed)
So all they will need to run your program is the class files or the jar file (if you put all your code in a jar file, and I recomend you do)
All you really need to do is put all in a jar file.Michael P. O'Connor
http://www.mikeoconnor.net
- 04-28-2010, 04:38 PM #5
Member
- Join Date
- Jan 2010
- Posts
- 44
- Rep Power
- 0
Many thanks to all of you! Special thanks to Drun!
My software imports a jar file for an external package.
How can I make my java code as a jar file with such a "imported" jar file?
Many thanks in advance!
- 04-28-2010, 10:54 PM #6
There are 2 ways I can think of. 1) include the jar file with your jar file and make sure you set up the class path when your program is ran. 2) (not 100% sure how to do this but I seen it done) unpack the other jar file, and pack the class files from inside of that jar file (a jar file is nothing more then a zip file with a few special directories and files inside of it) into your jar file.
Michael P. O'Connor
http://www.mikeoconnor.net
- 04-29-2010, 01:17 AM #7
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
It is possible to write code in Java and deploy it to machines that don't have a JRE installed -- but it's a particular subset of Java compiled into JavaScript by Google Web Toolkit and deployed to web browsers.
Google Web Toolkit - Google Code
I do not mean to suggest that this is a viable replacement for real Java. But depending on what it is, how it's designed, and how much Java it uses, it may be a possibility.
-Gary-
- 04-29-2010, 02:46 AM #8
Member
- Join Date
- Jan 2010
- Posts
- 44
- Rep Power
- 0
I think my question is a common concern for software developers. I want the users to make a simple click and then he/she can start the journey of using my soft.
If I make a jar file then the user need either:
1) Go to DOS and specify the class path
2) Go to eclipse and create the project.
I think 2) is easier but not everyone has Eclipse.
-
- 04-29-2010, 03:33 AM #10
Senior Member
- Join Date
- Mar 2010
- Posts
- 953
- Rep Power
- 4
As a practical matter, it's very unusual today for a piece of software not to have some sort of runtime requirement. More and more Windows software is based on the .NET runtime, and for many years before that there were Visual Basic runtimes and MFC dependencies and library dependencies people spoke of as ".DLL hell". And other platforms have their dependencies as well.
-Gary-
- 04-29-2010, 09:21 AM #11
Member
- Join Date
- Jan 2010
- Posts
- 44
- Rep Power
- 0
Thanks for your advises!
Can anyone tells me which option is better for the users to run the Java Software?
1. Use DOS Command to run the Jar file (I think users have to specify the class path)
2. Use Eclipse to run the Jar file
- 04-29-2010, 09:26 AM #12
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
1.) Works only on computers that have DOS.
2.) Eclipse is a development kit used by developers. Why would users need to install Eclipse to be able to run your program if they already have the JRE?
Better get Oracle's tutorial on jar files and deployment and read it.
- 04-29-2010, 09:38 AM #13
Member
- Join Date
- Jan 2010
- Posts
- 44
- Rep Power
- 0
Users can use DOS to run the .jar file. But it is complicated for them to specify the class path, isn't it?
- 04-29-2010, 09:40 AM #14
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
You would have to create the .bat file for them.
Much better is to read the tutorial I suggested so that you can create an executable jar than can be used on different platforms as long as they have the JRE.
- 04-29-2010, 09:43 AM #15
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
If you've built your jar file correctly (ie with the correct Manifest in it) the user should simply be able to double click on the jar and run it. If you have dependencies on thrid party jars then you package them with your jar. Netbeans creates a directoty structure something like:
and the Manifest refers to the jars in the lib directory.Java Code:dist -> MyJar.jar lib -> other libs
- 04-29-2010, 10:10 AM #16
Member
- Join Date
- Jan 2010
- Posts
- 44
- Rep Power
- 0
Can anyone tell me how to make the jar file and how to specify the class path when the users just want to use it?
Your help will be very much appreciated!
- 04-29-2010, 10:22 AM #17
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
- 04-29-2010, 11:20 AM #18
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Between that and my little diagram of a distribution structure you should be able to write this yourself.
- 04-29-2010, 11:30 AM #19
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,408
- Blog Entries
- 7
- Rep Power
- 17
A bit of an example; here's a manifest file I use:
Add this as your manifest in your .jar file (after supplying the necessary information) and you can simply double click on the .jar to run it.Java Code:Manifest-Version: 1.0 Created-By: my company Main-Class: MyMainClass Class-Path: relative/path/to/other/files.jar Built-By: my company Name: Name Of This Application Specification-Title: Title Of This Application Specification-Version: 1.0 Specification-Vendor: my company Implementation-Title: Title Of This Application Implementation-Version: 1.0 Implementation-Vendor: my company
kind regards,
Jos
Similar Threads
-
Software Engineer/Architect at Fast Model Software in Summit, NJ
By CarlSayres in forum Jobs OfferedReplies: 0Last Post: 01-15-2010, 07:16 AM -
Software Engineers - Java
By pooja_k in forum Jobs OfferedReplies: 0Last Post: 01-06-2010, 09:19 AM -
Senior Java Software Developer
By Java the Hut in forum Jobs OfferedReplies: 2Last Post: 08-22-2009, 06:21 PM -
Java Web software architect
By RonCourtech in forum Jobs OfferedReplies: 0Last Post: 09-22-2008, 04:21 PM -
java software for OMR
By priyarenjith in forum New To JavaReplies: 0Last Post: 07-02-2008, 08:55 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks