Как установить jre на windows server

java-logo70x45.jpg

First download the Java 8 Server JRE.

Choose the Windows x64 edition. Once downloaded, unzip the content to a temporary folder on your server.

Installation

  1. Create the folder C:Program FilesOracle Java Server on your server.

  2. Browse to the expanded content in your temporary folder. Go one level deeper e.g. jdk1.8.0_XX (where XX is the current update version) and copy this content to the new folder on your server.

Command line:

md "C:Program FilesOracle Java Server"
xcopy D:Tempjdk1.8.0_31*.* "C:Program FilesOracle Java Server" /s

(Make sure you change the update version number as appropriate).

Set JAVA_HOME environment variable

Finally we need to set an environment variable to point to our new Java installation:

  1. Open the control panel and choose the system applet
  2. Click the Advanced tab and the button Environment Variables
  3. Click New… at the System Variables
  4. Use JAVA_HOME as the name of the variable and the path C:Program FilesOracle Java Server as the value.
  5. Finish this job by clicking OK until your are back at the control panel.

Or using the command line:

setx JAVA_HOME "C:Program FilesOracle Java Server" /m

To check the environment variable has been set correctly:

  1. Open a new command prompt, type set and hit enter
  2. Scroll until you see the variable JAVA_HOME

Update

It is important to keep Java updated with the latest security patches. To do so, simply Stop your Tomcat-Service and repeat the installation steps from above, overwriting the existing files. Don’t forget to re-start Tomcat after the update.


Posted by Stuart Conner 2019-11-19T17:20:34Z

Hello all.

      Does anyone have any tips on getting Java 8 to install on Windows Server 2019 (without desktop experience)?

I need at least 8.171 for this platform I’m deploying and I’ve tried everything from trying to run directly on the server with the «Start» command, deploying the.exe silently with PDQ Deploy and even trying to extract the .msi out of the .exe and deploy it that way.

No matter what I try, it just hangs or bombs.

Does anyone have an experience they’d be willing to share? Thanks!

8 Replies

  • Author Nick Cunningham

    Nick-C


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    mace

    Have you tried the AdoptOpenJDK builds (especially now Oracle want to charge you for installing their java version in a business environment):

    https://adoptopenjdk.net/ Opens a new window 

    They provide native MSI installers which should be easier to deploy and they include support for setting reg keys the same as Oracle Java for dealing with any apps that explicitly check for these keys during install to verify java is installed.

    See partway down this page for more details on things like install switches to control what features/settings get enabled:

    https://adoptopenjdk.net/installation.html Opens a new window


    Was this post helpful?
    thumb_up
    thumb_down

  • Author jrp 78

    jrp78


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    ghost chili

    Windows Server Expert

    • check
      81
      Best Answers
    • thumb_up
      263
      Helpful Votes

    Don’t install it. Sandbox it! :)

    Get the zip version of it and extract it into the folder of your choosing. Then just update your PATH enviromental variable with the path to the extracted bin folder. I’ve used this method several times and it worked without issue.


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Stuart Conner

    Ah, I didn’t even know about this. Is it an open source alternative to JRE? I did install it on the server with no problem, but the software is still asking me to install JRE 8 171.


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Stuart Conner

    jrp78 wrote:

    Don’t install it. Sandbox it! :)

    Get the zip version of it and extract it into the folder of your choosing. Then just update your PATH enviromental variable with the path to the extracted bin folder. I’ve used this method several times and it worked without issue.

    This is an interesting way to do it. I’ll try it and see if I can get it working. Do I just download the .gz file from the Java site?


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Stuart Conner

    jrp78 wrote:

    Don’t install it. Sandbox it! :)

    Get the zip version of it and extract it into the folder of your choosing. Then just update your PATH enviromental variable with the path to the extracted bin folder. I’ve used this method several times and it worked without issue.

    Hey again,

           so I’m thinking this might be what I need to do, but I can’t seem to execute it properly. I’ve ran the installation for JRE 8.231 and it’s created a directory in my Program Files (see attached), but the program that I’m installing is still saying that it needs Java. Another strange thing is that the program actually tries to install JRE but it fails there as well.

    I have tried to setx through the command line (again, I’m running core), but either I didn’t do it correctly or it simply didn’t work.

    Would you be able to provide me with any other advice regarding this? I don’t want to, but if I can’t get this working properly I’ll have to re-install the OS with desktop experience. I’ve tested it there and it works flawlessly. I just really want to run core!

    Image: post content


    Was this post helpful?
    thumb_up
    thumb_down

  • Author Nick Cunningham

    Nick-C


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    mace

    Stuart Conner wrote:

    Ah, I didn’t even know about this. Is it an open source alternative to JRE? I did install it on the server with no problem, but the software is still asking me to install JRE 8 171.

    Yes, this is OpenJDK which is the FOSS version (but still binary compatible with Oracle Java), when you install it make sure you tell it to set the Oracle reg keys (FeatureOracleJavaSoft if you are using commandline options), as most software will check these keys to detect if Java is installed.


    Was this post helpful?
    thumb_up
    thumb_down

  • Author jrp 78

    jrp78


    This person is a Verified Professional

    This person is a verified professional.

    Verify your account
    to enable IT peers to see that you are a professional.

    ghost chili

    Windows Server Expert

    • check
      81
      Best Answers
    • thumb_up
      261
      Helpful Votes

    Stuart Conner wrote:

    jrp78 wrote:

    Don’t install it. Sandbox it! :)

    Get the zip version of it and extract it into the folder of your choosing. Then just update your PATH enviromental variable with the path to the extracted bin folder. I’ve used this method several times and it worked without issue.

    This is an interesting way to do it. I’ll try it and see if I can get it working. Do I just download the .gz file from the Java site?

    No, they have zip formats which I normally get. However, while this allows you to use Java without actually installing it, I didn’t mention the Oracle JRE roadmap. As mentioned above, AdoptOpenJDK and Amazon Corretto are strong/good alternatives. Oracle Java JRE will only be free to non-corporate users after this coming January in case you weren’t aware. 

    Having said that, I think you should be able to do the same thing of sandboxing it with AdoptOpenJDK, however, I’ve never tested this.

    When you tried your setx command, what happened and which variable were you trying to set? You should be able to test a variable’s values at the cmd prompt
    for example:     echo %path% 

    Finally, what is the app you are trying to get working? This may help us assist further.


    Was this post helpful?
    thumb_up
    thumb_down

  • Author binarylab

    Hi! 

    Here’s what I did to successfully install Java 8 u241 x64 on Server Core 2019 1909. 

    Run silent installation 

    BASH

    jre-8u241-windows-x64.exe /s
    

    When the installation is done reboot your computer.  

    The odd thing is that the installation doesn’t create JAVA_HOME system environment variable and its why it doesn’t work for you. Basically your application don’t know where to find Java. 

    Take a snapshot or backup your system before you change your system variables, believe me its very easy to wipe them from cmd.

    To add JAVA_HOME variable use 

    BASH

    setx -m JAVA_HOME "C:Program FilesJavajre1.8.0_241"
    

    The new variable will appear after system reboot. 

    To check system environment variables run set command.

    Here is my output.

    Text

    ALLUSERSPROFILE=C:ProgramData
    APPDATA=C:UsersAdministratorAppDataRoaming
    CLIENTNAME=DESKTOP-H9LM2FJ
    CommonProgramFiles=C:Program FilesCommon Files
    CommonProgramFiles(x86)=C:Program Files (x86)Common Files
    CommonProgramW6432=C:Program FilesCommon Files
    COMPUTERNAME=WIN-VGN8TEFLQG2
    ComSpec=C:Windowssystem32cmd.exe
    DriverData=C:WindowsSystem32DriversDriverData
    error=0
    GEOSERVER_DATA_DIR=C:geoserverdata_dir
    GEOSERVER_HOME=C:geoserver
    HOMEDRIVE=C:
    HOMEPATH=UsersAdministrator
    JAVA_HOME=C:Program FilesJavajre1.8.0_241
    JAVA_OPTS= -Xbootclasspath/a:"C:geoserverwebappsgeoserverWEB-INFlibmarlin-0.9.3.jar" -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine
    LOCALAPPDATA=C:UsersAdministratorAppDataLocal
    LOGONSERVER=\WIN-VGN8TEFLQG2
    MARLIN_ENABLER=-Xbootclasspath/a:"C:geoserverwebappsgeoserverWEB-INFlibmarlin-0.9.3.jar" -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine
    MARLIN_JAR=C:geoserverwebappsgeoserverWEB-INFlibmarlin-0.9.3.jar
    NUMBER_OF_PROCESSORS=2
    OS=Windows_NT
    Path=C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:UsersAdministratorAppDataLocalMicrosoftWindowsApps;;C:geoserver;C:UsersAdministratorAppDataLocalMicrosoftWindowsApps;
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
    PROCESSOR_ARCHITECTURE=AMD64
    PROCESSOR_IDENTIFIER=AMD64 Family 23 Model 8 Stepping 2, AuthenticAMD
    PROCESSOR_LEVEL=23
    PROCESSOR_REVISION=0802
    ProgramData=C:ProgramData
    ProgramFiles=C:Program Files
    ProgramFiles(x86)=C:Program Files (x86)
    ProgramW6432=C:Program Files
    PROMPT=$P$G
    PSModulePath=C:Program FilesWindowsPowerShellModules;C:Windowssystem32WindowsPowerShellv1.0Modules
    PUBLIC=C:UsersPublic
    RUN_JAVA=C:Program FilesJavajre1.8.0_241binjava
    SESSIONNAME=31C5CE94259D4006A9E4#0
    SystemDrive=C:
    SystemRoot=C:Windows
    TEMP=C:UsersADMINI~1AppDataLocalTemp2
    TMP=C:UsersADMINI~1AppDataLocalTemp2
    USERDOMAIN=WIN-VGN8TEFLQG2
    USERDOMAIN_ROAMINGPROFILE=WIN-VGN8TEFLQG2
    USERNAME=Administrator
    USERPROFILE=C:UsersAdministrator
    windir=C:Windows
    

       

    Some applications also requires path to Java bin folder in the path variable. 


    Was this post helpful?
    thumb_up
    thumb_down

Read these next…

  • Curated Switch replacement plan

    Switch replacement plan

    Best Practices & General IT

    How do you or feel about strategies on replacing network infrastructure devices. I feel it should be done by EOL date, I was expecting to have to do this year as some cat3000 devices were EOL, they have now changed that to 2025. When I started device repl…

  • Curated Reverse caption challenge: Show off your IT-themed AI art

    Reverse caption challenge: Show off your IT-themed AI art

    Water Cooler

    You’ve probably heard of a caption contest / challenge, where the goal is to submit the most clever or funny text to describe an image that someone else provides. But given advancements in technology, that’s old news now.Thanks to AI-powered image generat…

  • Curated Snap! -- Stalkerware, Partner Passwords, Surprise Moons, Vertical Pixel Displays

    Snap! — Stalkerware, Partner Passwords, Surprise Moons, Vertical Pixel Displays

    Spiceworks Originals

    Your daily dose of tech news, in brief.

    Welcome to the Snap!

    Flashback: February 6, 2015: RadioShack filed for bankruptcy (Read more HERE.)

    Bonus Flashback: February 6, 1971: First Golf Ball Hit on Moon (Read more HERE.)

    You need to he…

  • Curated How often do you take sick days?

    How often do you take sick days?

    Spiceworks

    Did you know that the first Monday in February is one of the most popular days of the year for calling in sick?  It has been THE most popular day in some years, though that varies, and it is called «Super Sick Monday» for that reason.  So, happy Super Sic…

  • Curated Network and Servers

    Network and Servers

    Networking

    Hello Guys,Yesterday I had a problem in my data center where pinging all the servers were «Timing out».All the clients connecting to access the services were complaining.From the WAN side, everything was running smoothly. I changed a couple of fiber a…

RRS feed

  • Remove From My Forums
  • General discussion

  • Hi,

    I am using AWS windows server 2016 64- bit. Is it possible to install Java 8 or Java 9 in Windows server 2016?

    or if we have any compatible issues with these versions of java.

    If you have the steps to install java 8/9 in windows server 2016, Please give me instructions.

    can you please let me know, which version of Java is compatible with windows server 2016?

    Thanks,

    Rajeev.

All replies

  • Hello,

    Link supply JRE, I need update in WS2016 as below, but ends with shown error, do you have any idea what to do…

    Thanks

  • Found it, you have to download manually. I found it here at this link.  

    https://java.com/en/download/manual.jsp

  • Remove From My Forums
  • Question

  • Good day.

    I’m wondering if any knows if it’s possible to install Java on Server Core 2008 R2 (or Hyper-V)? The reason that I’m asking is I’ve considered running Java-based applications on Server Core, again, for academics, and as a consideration for an alternative
    GUI/interface (I know it defeats the purpose), however, I know it would be far, far less over-head than a standard full install, while allowing me to keep track of everything, easier.  I know it won’t replace scripts, or batch files, but I want to see
    how well I can utilize Server Core (basically, a personal challenge on top of something functional).

    Peace

    PS: I have been looking around, but again, too much info, and it’s not clear enough.  Also, there’s interest in running Domino on it, and that seems to need Java for some reason.

Answers

  • Hi!

    I successfully installed Java Runtime Environment on Hyper-V Server. The installer complained that nlaapi.dll was missing, but the installation went ahead anyway.

    The Java.exe binary is at place in the Program Files (x86)Java directory, but the plug-in wouldn’t fire when visiting websites containing java applications using firefox, so I can’t say that java is functioning to its full extent like in a full GUI installation
    of windows. It’s however registered as an installed application.

    • Proposed as answer by

      Thursday, September 6, 2012 3:41 AM

    • Marked as answer by
      Arthur_LiMicrosoft contingent staff
      Monday, September 10, 2012 4:33 AM

  • Remove From My Forums
  • Question

  • Good day.

    I’m wondering if any knows if it’s possible to install Java on Server Core 2008 R2 (or Hyper-V)? The reason that I’m asking is I’ve considered running Java-based applications on Server Core, again, for academics, and as a consideration for an alternative
    GUI/interface (I know it defeats the purpose), however, I know it would be far, far less over-head than a standard full install, while allowing me to keep track of everything, easier.  I know it won’t replace scripts, or batch files, but I want to see
    how well I can utilize Server Core (basically, a personal challenge on top of something functional).

    Peace

    PS: I have been looking around, but again, too much info, and it’s not clear enough.  Also, there’s interest in running Domino on it, and that seems to need Java for some reason.

Answers

  • Hi!

    I successfully installed Java Runtime Environment on Hyper-V Server. The installer complained that nlaapi.dll was missing, but the installation went ahead anyway.

    The Java.exe binary is at place in the Program Files (x86)Java directory, but the plug-in wouldn’t fire when visiting websites containing java applications using firefox, so I can’t say that java is functioning to its full extent like in a full GUI installation
    of windows. It’s however registered as an installed application.

    • Proposed as answer by

      Thursday, September 6, 2012 3:41 AM

    • Marked as answer by
      Arthur_LiMicrosoft contingent staff
      Monday, September 10, 2012 4:33 AM

Понравилась статья? Поделить с друзьями:
  • Как установить jpeg на windows 10
  • Как установить joomla на компьютер windows 10
  • Как установить jmeter в windows 10
  • Как установить jbl speakershop на windows xp
  • Как установить javascript на windows 10