Solved start.bat now wont open


lilVloi

Member
Local time
10:01 AM
Posts
8
Location
London
OS
Windows 11 Home
Hey i want to create minecraft server on my localhost and i installed latest minecraft version and i created start.bat, inside it this code

@echo off
java -Xms#G -Xmx#G -XX:+UseG1GC -jar server.jar --nogui
pause

and i try to open start.bat its not opening and not doing anything

its .bat disabled on Windows 11 and i need to enable it ?
 
Windows Build/Version
Windows 11 Home 21H2 22000.593

My Computer

System One

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo
    CPU
    11 Gen Intel(R) Core(TM) i5-1125G7 @ 2.40GHz
    Memory
    8.00 GB (7.56 GB usable)
    Graphics Card(s)
    Intel(R) Iris(R) Xe Graphics
    Monitor(s) Displays
    Generic PnP Monitor
    Screen Resolution
    1920 x 1080
    Hard Drives
    UMIS RPJTJ256MEE1OSWX | Xvd
    Keyboard
    HID Keyboard Device | Standard PS/2 Keyboard
    Mouse
    HID-compliant mouse
    Browser
    Chrome
    Antivirus
    McAfee
Batch files are NOT disabled in Windows 11... can you try opening a normal command prompt in the directory and manually run the .bat file to see if an error comes up?
 

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD
Batch files are NOT disabled in Windows 11... can you try opening a normal command prompt in the directory and manually run the .bat file to see if an error comes up?
Hi thanks for replying, i did what u told to try to open it using Command Promppt and it worked but now im running on a new issue it says

Invalid initial heap size: -Xms#G
Error: Could not create the Java Virtual Machine.
Error: A fetal exception has occurred. Program will exit.
Press any key to continue . . .
 

My Computer

System One

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo
    CPU
    11 Gen Intel(R) Core(TM) i5-1125G7 @ 2.40GHz
    Memory
    8.00 GB (7.56 GB usable)
    Graphics Card(s)
    Intel(R) Iris(R) Xe Graphics
    Monitor(s) Displays
    Generic PnP Monitor
    Screen Resolution
    1920 x 1080
    Hard Drives
    UMIS RPJTJ256MEE1OSWX | Xvd
    Keyboard
    HID Keyboard Device | Standard PS/2 Keyboard
    Mouse
    HID-compliant mouse
    Browser
    Chrome
    Antivirus
    McAfee
Sadly, I don't know the syntax for running a Minecraft Server, but I thought you had to specify RAM, etc. which I didn't see in your switches.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD
As a test, save this as start.bat and see what happens.

Batch:
@echo off
java -jar server.jar --nogui
pause
 

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD
I see the problem now... in the switches you're using, you have the change the # to a number
So:
Batch:
java -Xms#G -Xmx#G -XX:+UseG1GC -jar server.jar --nogui
would be:
Batch:
java -Xms1G -Xmx2G -jar server.jar --nogui

I couldn't find info on -XX:+UseG1GC

Info taken from here: Tutorials/Setting up a server
 

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD
I see the problem now... in the switches you're using, you have the change the # to a number
So:
Batch:
java -Xms#G -Xmx#G -XX:+UseG1GC -jar server.jar --nogui
would be:
Batch:
java -Xms1G -Xmx2G -jar server.jar --nogui

I couldn't find info on -XX:+UseG1GC

Info taken from here: Tutorials/Setting up a server
that also didn't work,

C:\Users\lilVloi\Desktop\localhostserver>java -Xms1G -Xmx2G -jar server.jar --nogui
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

C:\Users\lilVloi\Desktop\localhostserver> _
 

My Computer

System One

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo
    CPU
    11 Gen Intel(R) Core(TM) i5-1125G7 @ 2.40GHz
    Memory
    8.00 GB (7.56 GB usable)
    Graphics Card(s)
    Intel(R) Iris(R) Xe Graphics
    Monitor(s) Displays
    Generic PnP Monitor
    Screen Resolution
    1920 x 1080
    Hard Drives
    UMIS RPJTJ256MEE1OSWX | Xvd
    Keyboard
    HID Keyboard Device | Standard PS/2 Keyboard
    Mouse
    HID-compliant mouse
    Browser
    Chrome
    Antivirus
    McAfee
By the looks, you're using an older version of JRE and need to install a newer one.

check
Batch:
java --version
 

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD
By the looks, you're using an older version of JRE and need to install a newer one.

check
Batch:
java --version
Oh i see now
 

My Computer

System One

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo
    CPU
    11 Gen Intel(R) Core(TM) i5-1125G7 @ 2.40GHz
    Memory
    8.00 GB (7.56 GB usable)
    Graphics Card(s)
    Intel(R) Iris(R) Xe Graphics
    Monitor(s) Displays
    Generic PnP Monitor
    Screen Resolution
    1920 x 1080
    Hard Drives
    UMIS RPJTJ256MEE1OSWX | Xvd
    Keyboard
    HID Keyboard Device | Standard PS/2 Keyboard
    Mouse
    HID-compliant mouse
    Browser
    Chrome
    Antivirus
    McAfee
Also, don't forget to accept the EULA by changing the value from false to true in the required file before you attempt to start it if you haven't already.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD
Also, don't forget to accept the EULA by changing the value from false to true in the required file before you attempt to start it if you haven't already.
yes i know about the EULA but how do i update java to be acceptable running a localhost server
 

My Computer

System One

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo
    CPU
    11 Gen Intel(R) Core(TM) i5-1125G7 @ 2.40GHz
    Memory
    8.00 GB (7.56 GB usable)
    Graphics Card(s)
    Intel(R) Iris(R) Xe Graphics
    Monitor(s) Displays
    Generic PnP Monitor
    Screen Resolution
    1920 x 1080
    Hard Drives
    UMIS RPJTJ256MEE1OSWX | Xvd
    Keyboard
    HID Keyboard Device | Standard PS/2 Keyboard
    Mouse
    HID-compliant mouse
    Browser
    Chrome
    Antivirus
    McAfee
yes i know about the EULA but how do i update java to be acceptable running a localhost server
is ther a way to do that using command prompt
 

My Computer

System One

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo
    CPU
    11 Gen Intel(R) Core(TM) i5-1125G7 @ 2.40GHz
    Memory
    8.00 GB (7.56 GB usable)
    Graphics Card(s)
    Intel(R) Iris(R) Xe Graphics
    Monitor(s) Displays
    Generic PnP Monitor
    Screen Resolution
    1920 x 1080
    Hard Drives
    UMIS RPJTJ256MEE1OSWX | Xvd
    Keyboard
    HID Keyboard Device | Standard PS/2 Keyboard
    Mouse
    HID-compliant mouse
    Browser
    Chrome
    Antivirus
    McAfee

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD
There isn't an 'easy' way to accept the EULA via command prompt, just open the text file, change the info and save it.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD
You can get the newest version of the Server from here: Minecraft Server Download with an example of the command to use in your batch file as well.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD

My Computer

System One

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo
    CPU
    11 Gen Intel(R) Core(TM) i5-1125G7 @ 2.40GHz
    Memory
    8.00 GB (7.56 GB usable)
    Graphics Card(s)
    Intel(R) Iris(R) Xe Graphics
    Monitor(s) Displays
    Generic PnP Monitor
    Screen Resolution
    1920 x 1080
    Hard Drives
    UMIS RPJTJ256MEE1OSWX | Xvd
    Keyboard
    HID Keyboard Device | Standard PS/2 Keyboard
    Mouse
    HID-compliant mouse
    Browser
    Chrome
    Antivirus
    McAfee
Honestly don't know since I've never tried it, but I 'think' you only need the JRE and not the JDK, but if you want, the JDK won't hurt you any (just take up a little more room on your drive) as the JDK integrates the JRE inside it.
 

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD
Honestly don't know since I've never tried it, but I 'think' you only need the JRE and not the JDK, but if you want, the JDK won't hurt you any (just take up a little more room on your drive) as the JDK integrates the JRE inside it.
Thank u so much i think the problem has been solved, i just need to update the java version ;3
 

My Computer

System One

  • OS
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Lenovo
    CPU
    11 Gen Intel(R) Core(TM) i5-1125G7 @ 2.40GHz
    Memory
    8.00 GB (7.56 GB usable)
    Graphics Card(s)
    Intel(R) Iris(R) Xe Graphics
    Monitor(s) Displays
    Generic PnP Monitor
    Screen Resolution
    1920 x 1080
    Hard Drives
    UMIS RPJTJ256MEE1OSWX | Xvd
    Keyboard
    HID Keyboard Device | Standard PS/2 Keyboard
    Mouse
    HID-compliant mouse
    Browser
    Chrome
    Antivirus
    McAfee
Welcome, glad I could help...
 

My Computers

System One System Two

  • OS
    Windows 11 Pro β
    Computer type
    Laptop
    Manufacturer/Model
    HP Pavilion Laptop 15-eg0070wm
    CPU
    Intel® Core™ i7-1165G7
    Memory
    32 GB DDR4-3200 SDRAM
    Graphics Card(s)
    Intel® Iris® Xᵉ Graphics
    Screen Resolution
    1920x1080
    Hard Drives
    2TB PCIe® NVMe™ M.2 SSD
  • Operating System
    macOS Ventura
    Computer type
    PC/Desktop
    Manufacturer/Model
    Apple iMac 27" 5K (2017)
    CPU
    3.4 GHz Quad-Core Intel Core i5
    Memory
    40 GB 2400 MHz DDR4
    Graphics card(s)
    Radeon Pro 570 4 GB
    Monitor(s) Displays
    27" 5K, 34" UW
    Screen Resolution
    Mon 1: 5120 × 2880 Mon 2: 2560 x 1080
    Hard Drives
    32GB NVME, 1TB SSD

Latest Support Threads

Back
Top Bottom