• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to deploy a Java jar file correctly?  RSS feed

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) I created a test Windows 7 x64 VM
2) I downloaded the java x86 runtime
3) copied the files and database over to the correct directories
4) No running. Just javaw32.exe

Any help please?
Thanks
Jack
 
Nam Ha Minh
Ranch Hand
Posts: 515
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is not running? Please be more specific so we can help.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nam Ha Minh wrote:What is not running? Please be more specific so we can help.


Hi Nam Ha Minh,
I clicked on the executable jar file, which had been compiled successfully on my development platform, but there was nothing coming out of the screen on the production platform (Win7 x64 VM), no GUI, just nothing
Thanks
Jack
 
Nam Ha Minh
Ranch Hand
Posts: 515
Eclipse IDE Firefox Browser Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There might be an error while launching the jar file. Try :



That brings the console in which you can see error/exception.
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens when you run your .jar from the command line? And what file association have you got set up?
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:What happens when you run your .jar from the command line? And what file association have you got set up?


Two problems
1) After testing it the way you told me to, I found that the path for java bin was not set, the user has to set it himself?
2) There is an error coming up, I have no Access 2007 installed on this machine, if that matters
[translated by google translate]
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, of course you have to set the path yourself. Start reading here.
You usually get a completely different sort of error if your path isn’t correct.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Yes, of course you have to set the path yourself. Start reading here.
You usually get a completely different sort of error if your path isn’t correct.


Hello Campbell,
Assuming the user is a novice, can I automate the path "creation" process?
Thanks
Jack
 
Paul Clapham
Sheriff
Posts: 22841
43
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sure you can. If it's a Windows computer the standard way to install software is to use a Windows MSI file. That of course has nothing to do with Java and creating one of those is a totally different skill set.

However if you want to distribute Java programs to be run on other people's computers, the Java-oriented way to do that is via Java Web Start. In that scenario you host the program on your web site and write a file in a special XML-based format which describes how to download it. This is a much easier way to do it than learning the tedious details of what's involved in installing software on a variety of operating systems.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:Sure you can. If it's a Windows computer the standard way to install software is to use a Windows MSI file. That of course has nothing to do with Java and creating one of those is a totally different skill set.

However if you want to distribute Java programs to be run on other people's computers, the Java-oriented way to do that is via Java Web Start. In that scenario you host the program on your web site and write a file in a special XML-based format which describes how to download it. This is a much easier way to do it than learning the tedious details of what's involved in installing software on a variety of operating systems.


Thanks Paul,
I've decided to use innosetup now because I can't afford Advanced Installer.
However, if you know a bit of scripting, how do you setup JRE paths (JAVA_HOME and path) in innosetup, Java doesn't install those paths on 64-bit machines which causes some hassles
Can't find anything relevant on the net
Basically I want to automate these steps
0) make sure Access 2007 is installed on your computer
1) Install Java Runtime to the machine you use
2) Add %JAVA_HOME% to environment variable
3) Add Path to environment variable
4) Run setup.exe
6) Run the program

The problem I am currently having with {pf}\java\jre7\bin is that I can't be sure that {pf} is the program files I am referring to, the user might be installing applications to dozens of program files folders on different drives.

Thanks
Jack
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!