Solved

How do I silently install Java's SDK and the JRE?

Posted on 2006-06-23
7
697 Views
Last Modified: 2008-02-01
Hello all,

I'm trying to package up both Apache Tomcat and the JDK, along with my own web app into an installer package, so I can simplify deployment.

During the process, I execute 'j2sdk-1_4_2_08-windows-i586-p.exe "/s /v"/qn JAVAUPDATE=0"', to install the JDK silently. The JDK gets installed, but not the java runtime, so when Apache Tomcat is installed, it doesn't find the version of java to use, and won't start up.

But if I manually install j2sdk-1_4_2_08-windows-i586-p.exe, both the JDK and JRE are installed.  After that, I can install Tomcat, it picks up on the Java version, and runs fine.

So, any ideas as to what I'm missing? How can I silently install all the java components that Tomcat needs to run?

Any thoughts would be appreciated, I'm a little stuck on this one.

Thanks!
0
Comment
Question by:Inward_Spiral
7 Comments
 
LVL 30

Expert Comment

by:mayankeagle
ID: 16969411
The JDK also contains a JRE. Set your JAVA_HOME environment variable to point to the root installation folder of JDK. %JAVA_HOME%\jre contains the JRE.
0
 

Author Comment

by:Inward_Spiral
ID: 16969705
I'm setting both CATALINA_HOME and JAVA_HOME with VBScript during the install:

Set args=wscript.arguments
Set oShell = CreateObject("WScript.Shell")
Set oWshSystemEnv = oShell.Environment("SYSTEM")
oWshSystemEnv("CATALINA_HOME") = args(0)
oWshSystemEnv("JAVA_HOME") = args(1)

I've checked the registry, if I install Tomcat silently after a manual install of the JDK, I see a "Jvm" registry entry in "HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\Tomcat5\Parameters\Java".

But if I silently install both of them, the "Jvm" entry isn't there, and the Tomcat service won't start up.

Messing with registry entries isn't always a good thing, anyone have a suggestion on how to get past this without registry hacks?

0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 16969868
Then it perhaps needs that entry to be present - otherwise maybe you can specify it as a parameter to Tomcat while starting up as an extra command-line argument.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 26

Expert Comment

by:ksivananth
ID: 16971876
make sure you make the registry entry for java when you are installing java in silent mode.
0
 
LVL 6

Accepted Solution

by:
phuocnh earned 200 total points
ID: 16977852
Hi Inward_Spiral!
I have played with JDK so many times! :)
You install JDK in any box you have and copy entire the folder containing it into the destination box. That is enough.
So, when I made the installer I just packed entire JDK folder and set environment variables in tomcat start up script file (JAVA_HOME). I didn't have to set the registry because of the potential hazards.
Phuoc

0
 

Author Comment

by:Inward_Spiral
ID: 17146143
Sorry for the delay, phuocnh's solution worked for my initial test, but I got pulled onto another project before I could add everything I wanted to the package.

I swear, if I had a dollar for every time that happened...
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
count8 challlenge 13 85
countX 22 70
What is the latest versions eclipse neon 2 117
Java - Why doesn't this JFrame work 3 16
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now