Error invalid or corrupt jarfile app jar

I followed the Spring official tutorial(https://spring.io/guides/gs/spring-boot-docker/) to build springBoot-based app to docker image. The docker image was built successfully, but when I wanted to

I followed the Spring official tutorial(https://spring.io/guides/gs/spring-boot-docker/) to build springBoot-based app to docker image. The docker image was built successfully, but when I wanted to execute docker run command to start a container, I got the following error message:

Error: Invalid or corrupt jarfile /app.jar

and the containner couldn’t start running normally.

Has anybody gotten the same error message before? I really need your help. Thank you very much!

BMW's user avatar

BMW

41.4k12 gold badges95 silver badges115 bronze badges

asked Dec 9, 2015 at 3:23

Charles Wang's user avatar

3

Structure of java aplication

Demo
└── src
|    ├── main
|    │   ├── java
|    │   │   └── org
|    │   │       └── demo
|    │   │           └── Application.java
|    │   └── resources
|    │       └── application.properties
|    └── test
|         └── java
|               └── org
|                   └── demo
|                         └── Application.java  
├──── Dockerfile
├──── pom.xml

Content of pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.executablejar</groupId>
<artifactId>demo</artifactId>
<packaging>jar</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>demo Maven Webapp</name>
<url>http://maven.apache.org</url>

<properties>
    <java-version>1.8</java-version>
    <docker.image.prefix>springDemo</docker.image.prefix>
</properties>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.3.3.RELEASE</version>
</parent>

<dependencies>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
    </dependency>

    <dependency>
        <groupId>org.apache.tomcat.embed</groupId>
        <artifactId>tomcat-embed-jasper</artifactId>
    </dependency>

</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
    <finalName>demo</finalName>
</build>

Content of Dockerfile

FROM java:8
EXPOSE 8080
ADD /target/app.jar demo.jar
ENTRYPOINT ["java","-jar","demo.jar"]

Commands to build and run image

Go to the directory of project.Lets say D:/Demo

$ cd D/demo
$ mvn clean install
$ docker build demo .
$ docker run -p 8080:8080 -t demo

answered Apr 4, 2016 at 9:02

Riddhi Gohil's user avatar

Riddhi GohilRiddhi Gohil

1,72016 silver badges17 bronze badges

0

You have to add the JAR_FILE build arg to the dockerfile-maven-plugin, since it is missing in the code sample provided by the spring tutorial:

<plugin>
   <groupId>com.spotify</groupId>
   <artifactId>dockerfile-maven-plugin</artifactId>
   <version>1.4.9</version>
   <configuration>
      <repository>${docker.image.prefix}/${project.artifactId}</repository>
      <buildArgs>
         <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
      </buildArgs>
   </configuration>
</plugin>

answered Sep 4, 2019 at 8:17

vladBaluta's user avatar

I had the same problem, check the name of jar application in dockerFile

answered Apr 7, 2020 at 14:14

Yousra ADDALI's user avatar

Yousra ADDALIYousra ADDALI

3321 gold badge3 silver badges14 bronze badges

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account


Closed

ccit-spence opened this issue

Apr 13, 2015

· 14 comments

Comments

@ccit-spence

I have setup the following Dockerfile. Everything seems to build fine but getting the error that it is corrupt. I did verify that java 8 is set in the POM and manually executed the jar so I know it is working. The other change is that I moved the Dockerfile to the project root. Docker complains about any type of ../ being used to get a path.

Should this work?

FROM dockerfile/java:oracle-java8
VOLUME /tmp
ADD target/core-0.1.0-RELEASE.jar app.jar
RUN bash -c 'touch /app.jar'
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=local","/app.jar"]

@dsyer

It depends on the pom (which you don’t show). Dockerfile ADD works relative to the Dockerfile, so for yours to work you need to copy the jar file to a «target» directory in «target/docker». The maven plugin allows you to do that with a <resources/> element.

@ccit-spence

I am actually using the IntelliJ to build the Docker Image. So maven is not being used to build the image. Are you saying that this is how the ADD should look? ADD target/core-0.1.0-RELEASE.jar target/app.jar

@ccit-spence

ok, got it to work.

FROM dockerfile/java:oracle-java8
VOLUME /tmp
ADD target/core-0.1.0-RELEASE.jar target/app.jar
RUN bash -c 'touch target/app.jar'
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=local","target/app.jar"]

@ccit-spence

Thanks for the pointer on the target I am still learning Docker. Finding it important for working with Spring Cloud at the desktop level.

@DILEEP-YADAV

Same issue! Please help me.

error

@DILEEP-YADAV

I am using Gitlab CI AutoDev tool for build docker image for spring boot app with MySQL.
a build is the success but running» docker-compose up » getting the same issue. It working fine on my local build image. Please help me.

@DILEEP-YADAV

compose.yml

version: '3'

services:
  docker-mysql:
    image: mysql:latest
    environment:
      - MYSQL_ROOT_PASSWORD=12345
      - MYSQL_DATABASE=TechlaviyaDB
      - MYSQL_PASSWORD=12345

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    links:
      - docker-mysql
    environment:
      PMA_HOST: docker-mysql
      PMA_PORT: 3306
    ports:
      - '8081:80'
  docker-webapp:
    image: registry.gitlab.com/techlaviya/techlaviya/master:fb9e0213d6d4f385161e29561e626090a780e517
    depends_on:
      - docker-mysql
    ports:
      - 8080:8080
    environment:
      - DATABASE_HOST=docker-mysql
      - DATABASE_USER=root
      - DATABASE_PASSWORD=12345
      - DATABASE_NAME=TechlaviyaDB
      - DATABASE_PORT=3306

@DILEEP-YADAV

Dockerfile

FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
ADD ${JAR_FILE} TECHLAVIYA.jar
ENTRYPOINT [«java»,»-Djava.security.egd=file:/dev/./urandom»,»-jar»,»/TECHLAVIYA.jar»]

@DILEEP-YADAV

pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.techlaviya.lfee</groupId>
	<artifactId>techlaviya</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>techlaviya</name>
	<description>Demo project for Spring Boot</description>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.5.8.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
		<start-class>com.techlaviya.lfee.TechlaviyaApplication</start-class>
		<docker.image.prefix>techlaviya</docker.image.prefix>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.jayway.jsonpath</groupId>
			<artifactId>json-path</artifactId>
			<scope>test</scope>
		</dependency>


		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger2</artifactId>
			<version>2.4.0</version>
		</dependency>
		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger-ui</artifactId>
			<version>2.4.0</version>
		</dependency>


		<dependency>
			<groupId>io.jsonwebtoken</groupId>
			<artifactId>jjwt</artifactId>
			<version>0.6.0</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>2.8.9</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.mobile</groupId>
			<artifactId>spring-mobile-device</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-rest</artifactId>
		</dependency>


	</dependencies>

	<build>
		<finalName>TECHLAVIYA</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<!-- tag::plugin[] -->
			<plugin>
				<groupId>com.spotify</groupId>
				<artifactId>dockerfile-maven-plugin</artifactId>
				<version>1.3.6</version>
				<executions>
					<execution>
						<id>default</id>
						<goals>
							<goal>build</goal>
							<goal>push</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<repository>${docker.image.prefix}/${project.artifactId}</repository>
					<buildArgs>
						<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
					</buildArgs>
				</configuration>


			</plugin>
			<!-- end::plugin[] -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>unpack</id>
						<phase>package</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>${project.groupId}</groupId>
									<artifactId>${project.artifactId}</artifactId>
									<version>${project.version}</version>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>


</project>

@givenm

For me when I was having the issue, all I did was put the JAR_FILE argument in the pom without the forward slash «/» and it worked.

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>1.2.0</version>
                <configuration>
                    <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
                    <imageTags>
                        <imageTag>${project.version}</imageTag>
                        <imageTag>latest</imageTag>
                    </imageTags>
                    <!-- optionally overwrite tags every time image is built with docker:build -->
                    <forceTags>true</forceTags>
                    <dockerDirectory>src/main/docker</dockerDirectory>
                    <buildArgs>
                        <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                    </buildArgs>
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}</directory>
                            <include>${project.build.finalName}.jar</include>
                        </resource>
                    </resources>
                </configuration>
            </plugin>
        </plugins>
    </build>

Also my Dockerfile is like below


FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

@dsyer

This issue was closed some time ago and the guide has changed a lot since. If you have a usage question please go to Stack Overflow. If you find an actual bug in the guide sample, then report it here as a separate issue.

@ashish3016

FROM ibmjava:8

MAINTAINER «ashish taware»

RUN mkdir -p /var/log/java-web-app

EXPOSE 8080 8081

COPY myjar.jar /opt/aws/

WORKDIR /opt/aws/

CMD [«java», «-jar»,»myjar.jar»]

this is my dockerfile, it built successfully but when i want to run executable JAR the error occurred which is INVALID OR CURRUPT JAR file,

pls help me…

@sachinletsgo

@ashish3016 … I am facing the same issue. Found any solutions?

@givenm

This is what worked for me:

FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
MAINTAINER xxx@gmail.com

The pom.xml build is:

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>1.2.0</version>
                <configuration>
                    <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
                    <imageTags>
                        <imageTag>${project.version}</imageTag>
                        <imageTag>latest</imageTag>
                    </imageTags>
                    <!-- optionally overwrite tags every time image is built with docker:build -->
                    <forceTags>true</forceTags>
                    <dockerDirectory>src/main/docker</dockerDirectory>
                    <buildArgs>
                        <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                    </buildArgs>
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}</directory>
                            <include>${project.build.finalName}.jar</include>
                        </resource>
                    </resources>
                </configuration>
            </plugin>
        </plugins>
    </build>

Данная публикация посвящается всем ценителям Minecraft и других игр, требующих установки Java. На днях знакомые попросили помочь: при попытке запустить Майнкрафт у них появлялось сообщение — Java Virtual Machine Launcher ошибка, как исправить сейчас расскажу.

При установке Джавы, необходимой для работы некоторых игр, отображалось следующее окно:

Она указывает на то, что для создаваемой виртуальной машины не хватает памяти. Очень часто подобная ситуация возникает, если некорректно выходить из игры (нажав Alt + F4 ) или при внезапном отключении ПК.

В моем случае, ошибка появилась после того, как пользователь случайно удалил компонент Java, потом пытался его переустановить, но на последнем этапе инсталляции отображалось вышеупомянутое окно.

На зарубежных источниках нашел два решения. Начну с более простого.

Теперь при запуске установщика Джава ошибка Java Virtual Machine Launcher не появиться.

Переходим ко второму способу.

Покажу всё на примере Minecraft.

Вы узнали, как исправить ошибку Java Virtual Machine Launcher. Но если вопросы остались, обязательно задавайте их с помощью формы комментирования внизу страницы.

Источник

Invalid or corrupt jarfile

В IntelliJ IDEA-14 создал проект, в параметрах версия Java 1.8, на моем компе запускается и из IDEA, и jar-артифакт. Перенес jar на другой комп, поставил там Java 1.8.66 распоследнюю — пишет такую ошибку при запуске. Про manifesrt ничего не знаю пока, буду читать еще.

Как вообще надо создавать нормальные стандалон-приложения на java?

Скорее всего у тебя действительно повредился файл в процессе переноса.

Ладно, попробую перенести еще раз (как доберусь до компа с исходниками), хотя сомнительно что проблема в этом.

Jar-файл это просто ZIP-архив. Попробуй его разархивировать любым архиватором. Если получится — можно дальше думать. Если не получится — значит файл повреждён.

Фигасе, действительно обычный архив! 🙂 Открывается, там оказывается запихнуто все что надо и не надо из сорцов проекта. Файл вроде не поврежден, как я и подозревал.

Покажи вывод jar tf usergrid-launcher-1.0-SNAPSHOT.jar

Виндовая (знаю где я, не бейте :)) недоконсоль закрывается и не дает прочитать что там написано. Щас буду пробовать победить это и покажу.

«jar» не является внутренней или внешней командой, исполняемой программой или пакетным файлом.

jdk установи для начала

Хороший вопрос. Могу установить конечно, но зачем мне он на машине, где я хочу только запускать готовые приложения? Или Java-программы не будут работать на компах где есть только jre?

Будут, естественно. Но если вам нужно разрабатывать, вам нужен jdk. Почему вы удивляетесь тому, что у вас нет команды jar, если не установлен jdk?

Понял, ради этой команды сейчас качаю и установлю jdk последний. Хотя на этом компе я хотел только запустить программку, которую написал на другом, где она запускается (и где конечно и jre и jdk).

Поставил jdk, написала саксессфулли инсталлед, но jar и javac команды консоль до сих пор не знает. Наверное надо патхи приписывать руками. Не знаю в чем проблема. Как в 17 веке прямо все — консоль, ручное подключение.

В каталоге установленных программ теперь 2 папки — jre1.8.0_66 и jdk1.8.0_66, в которой своя подпапка jre. java -version в консоли пишет версию jre, javac и jar не работают. Перегружался. Монитор протирал. Мыслей нет.

Источник

Fix Minecraft Forge Error Invalid or Corrupt Jarfile

Up next
The Sims 4 is Already Running | Fix This Error on PC and Mac
Author
Steven P. Ross
Share article

Error: Invalid or Corrupt Jarfile. This is a common Minecraft error, and the fix for this issue is quite simple.

The “how to check if jar file is corrupted” is a common error that can occur when users try to install Minecraft Forge. The good news is that there are many ways for users to fix the issue.

If you’re having trouble installing Minecraft Forge due to an invalid or corrupt jarfile issue, keep reading to find out what’s causing it and how to repair it.

How to Repair a Corrupt or Invalid Jarfile in Minecraft Forge

1. Double-check that the download is complete.

You’ll receive a variety of problems if you attempt to run the game before it’s finished downloading, including the invalid or corrupt jarfile error.

Check to see whether Minecraft Forge has shown in your downloads folder. Then, make sure it’s not being blocked by your browser for any reason.

Recover the file in your browser’s download manager and try again.

2. Switch to a different browser.

Many of the customers who reported invalid or corrupt jarfile problems in Minecraft downloaded the game using Firefox.

The Minecraft Forge download seems to be often blocked by Firefox. As a result, we recommend that you try downloading the game using a different browser.

3. Install the most recent version of Java.

Make sure your computer has the most recent Java version installed. If you’re using an older version, download a newer one.

4. Turn off all background applications.

Remember to close all background applications and processes before installing Minecraft Forge or any other game or software on your computer.

Some of the applications that are currently operating on your computer may prevent the download from taking place. Alternatively, they may cause Minecraft Forge to crash when you attempt to load the launcher.

Using Task Manager or a clean start of your computer, you may close background applications.

If you’d rather utilize Task Manager, go to the Processes tab and right-click on the applications you wish to turn off. Then choose Finish Task.

You may also turn off your antivirus and firewall for a while. Certain Minecraft files may be erroneously flagged as suspicious by these applications, causing them to be blocked.

After you’ve downloaded and installed Minecraft Forge, remember to re-enable your antivirus and firewall.

We’re hoping for some assistance.

Frequently Asked Questions

How do I fix invalid or corrupt Jarfile?

A: Delete the file and then re-download it from our website.

How do I fix Minecraft Forge error?

A: The error you are receiving is most likely related to the Minecraft Forge. To fix this, try updating your version of minecraft. If that doesnt work, try using a different launcher such as MCPatcher or Mod Organizer

  • invalid or corrupt jarfile windows 10
  • how to fix unable to access jarfile
  • error: invalid or corrupt jarfile mac
  • shockbyte invalid or corrupt jarfile
  • unable to access jarfile forge

Hi, I’m Steven. I run this Blog myself and I’ve been in the electronics industry for a while so I know my stuff. The guides on this website are well researched and I also have experience with most of them. Do comment if you think some information is not correct on a particular page.

Источник

*** MOROZILKA ***

Меню навигации

Пользовательские ссылки

Информация о пользователе

Вы здесь » *** MOROZILKA *** » другие сервера » не могу запустить Minecraft — Invalid or corrupt jarfile

не могу запустить Minecraft — Invalid or corrupt jarfile

Сообщений 1 страница 12 из 12

Поделиться103-06-2012 03:37:59

  • Автор: FantOzer
  • Админ
  • Откуда: Новосибирск
  • Зарегистрирован : 09-12-2009
  • Приглашений: 0
  • Сообщений: 10032
  • Уважение: +496
  • Позитив: +598
  • Пол: Мужской
  • Провел на форуме:
    4 месяца 18 дней
  • Последний визит:
    Сегодня 04:38:00

Не могу запустить Minecraft
Будь проклята эта ява..) на которой работает игра.
она меня уже вымотала.

Помогите кто нибудь запустить игру.
Запускаются без проблема игра та — где НЕвозможно сменить ник..
Игра автоматом ставит имя player и хоть ты тресни.
А при подключени к серверу через какой то время выкидывает..

Если коротко, то лицензия запускается нормально но без регистрации на оф.сайте не дает сменить ник в игре.
А при запуске пиратки, что очень хотелось бы — пишет что файл инвалид.

Поделиться203-06-2012 03:38:44

  • Автор: FantOzer
  • Админ
  • Откуда: Новосибирск
  • Зарегистрирован : 09-12-2009
  • Приглашений: 0
  • Сообщений: 10032
  • Уважение: +496
  • Позитив: +598
  • Пол: Мужской
  • Провел на форуме:
    4 месяца 18 дней
  • Последний визит:
    Сегодня 04:38:00

Ставлю другие сборки, в т.ч. которые стоят у других игроков.. У них все норм, цепляются к серверу.
Но у меня же она даже и не запускается. пишет что — Invalid or corrupt jarfile.

Источник

Как исправить фатальную ошибку виртуальной машины Java в Windows 10

Неустранимая ошибка исключения виртуальной машины Java появляется у некоторых пользователей, когда они пытаются запустить программное обеспечение, построенное на Java. Полное сообщение об ошибке гласит: « Не удалось создать виртуальную машину Java. Ошибка: произошла фатальная исключительная ситуация. »Следовательно, Java-программа не запускается. Это несколько потенциальных исправлений для фатальной ошибки виртуальной машины Java.

Решения для исправления ошибок виртуальной машины Java

1. Установите новую системную переменную для Java

Ошибка виртуальной машины Java часто возникает, когда Java требуется больший глобальный максимальный размер кучи памяти. Пользователи исправили проблему, увеличив максимальный объем оперативной памяти, выделенной для Java. Пользователи могут сделать это, установив новую системную переменную Java следующим образом.

  • Откройте «Выполнить» с помощью сочетания клавиш Windows + R.
  • Введите «sysdm.cpl» в «Выполнить» и нажмите ОК , чтобы открыть окно на изображении непосредственно ниже.

  • Выберите вкладку Advanced в этом окне.
  • Нажмите кнопку Переменные среды , чтобы открыть окно ниже.

  • Нажмите кнопку Создать под полем Системные переменные.
  • Введите «_JAVA_OPTIONS» в текстовое поле «Имя переменной».

  • Затем введите «–Xmx512M» в текстовом поле «Значение переменной», что увеличит объем оперативной памяти до 512 мегабайт.

  • Нажмите кнопку ОК , чтобы закрыть окно.
  • Затем нажмите кнопку ОК в окнах среды.

– СВЯЗАННО: Как удалить всплывающее окно «Обновление Java доступно»

2. Выберите опцию Запуск от имени администратора для Java

Ошибка виртуальной машины Java также может быть связана с недостаточными правами администратора. Таким образом, некоторым пользователям может потребоваться назначить права администратора для Java. Пользователи могут назначать права администратора для Java в Windows 10 следующим образом.

  • Откройте Cortana с помощью сочетания клавиш Windows + Q.
  • Введите «Java» в поле поиска.
  • Затем щелкните правой кнопкой мыши Java и выберите Открыть местоположение файла , чтобы открыть папку Java в проводнике.

  • Теперь пользователи могут щелкнуть правой кнопкой мыши файл java.exe и выбрать Свойства .

  • Выберите вкладку «Совместимость».

  • Выберите Запустить эту программу от имени администратора .
  • Выберите параметр Применить .
  • Нажмите ОК , чтобы закрыть окно.

3. Переустановите Java

  • Переустановка Java может также исправить ошибку виртуальной машины Java для некоторых пользователей. Сначала удалите установленную версию Java, введя «appwiz.cpl» в «Выполнить» и нажав ОК .

  • Введите «Java» в поле поиска.
  • Выберите Java и нажмите Удалить .
  • Нажмите Да в любом открывшемся окне подтверждения.
  • После этого перезапустите Windows.
  • Затем откройте страницу загрузки Java в браузере.

  • Пользователям нужна 32-битная Java для 32-битных программ и 64-битная Java для 64-битного программного обеспечения. В случае сомнений лучше всего загрузить и установить обе версии Java, нажав Windows Offline и Windows Offline 64-bit .
  • После этого откройте мастер установки Java.
  • Нажмите кнопку Установить в мастере настройки.

Таким образом, пользователи могут исправить фатальную ошибку виртуальной машины Java. Эти разрешения обычно исправляют фатальную ошибку виртуальной машины Java, чтобы пользователи могли запускать необходимое программное обеспечение Java.

Источник

Error: Invalid or Corrupt Jarfile. This is a common Minecraft error, and the fix for this issue is quite simple.

The “how to check if jar file is corrupted” is a common error that can occur when users try to install Minecraft Forge. The good news is that there are many ways for users to fix the issue.

Fix Minecraft Forge Error Invalid or Corrupt Jarfile

minecraft forge error invalid or corrupt jarfile

If you’re having trouble installing Minecraft Forge due to an invalid or corrupt jarfile issue, keep reading to find out what’s causing it and how to repair it.

How to Repair a Corrupt or Invalid Jarfile in Minecraft Forge

1. Double-check that the download is complete.

You’ll receive a variety of problems if you attempt to run the game before it’s finished downloading, including the invalid or corrupt jarfile error.

Check to see whether Minecraft Forge has shown in your downloads folder. Then, make sure it’s not being blocked by your browser for any reason.

Recover the file in your browser’s download manager and try again.

2. Switch to a different browser.

Many of the customers who reported invalid or corrupt jarfile problems in Minecraft downloaded the game using Firefox.

The Minecraft Forge download seems to be often blocked by Firefox. As a result, we recommend that you try downloading the game using a different browser.

3. Install the most recent version of Java.

Make sure your computer has the most recent Java version installed. If you’re using an older version, download a newer one.

4. Turn off all background applications.

Remember to close all background applications and processes before installing Minecraft Forge or any other game or software on your computer.

Some of the applications that are currently operating on your computer may prevent the download from taking place. Alternatively, they may cause Minecraft Forge to crash when you attempt to load the launcher.

Using Task Manager or a clean start of your computer, you may close background applications.

If you’d rather utilize Task Manager, go to the Processes tab and right-click on the applications you wish to turn off. Then choose Finish Task.

You may also turn off your antivirus and firewall for a while. Certain Minecraft files may be erroneously flagged as suspicious by these applications, causing them to be blocked.

After you’ve downloaded and installed Minecraft Forge, remember to re-enable your antivirus and firewall.

We’re hoping for some assistance.

Frequently Asked Questions

How do I fix invalid or corrupt Jarfile?

A: Delete the file and then re-download it from our website.

How do I fix Minecraft Forge error?

A: The error you are receiving is most likely related to the Minecraft Forge. To fix this, try updating your version of minecraft. If that doesnt work, try using a different launcher such as MCPatcher or Mod Organizer

  • invalid or corrupt jarfile windows 10
  • how to fix unable to access jarfile
  • error: invalid or corrupt jarfile mac
  • shockbyte invalid or corrupt jarfile
  • unable to access jarfile forge

Hi, I’m Steven. I run this Blog myself and I’ve been in the electronics industry for a while so I know my stuff. The guides on this website are well researched and I also have experience with most of them. Do comment if you think some information is not correct on a particular page.

ccit-spence opened this issue 8 years ago · comments

I have setup the following Dockerfile. Everything seems to build fine but getting the error that it is corrupt. I did verify that java 8 is set in the POM and manually executed the jar so I know it is working. The other change is that I moved the Dockerfile to the project root. Docker complains about any type of ../ being used to get a path.

Should this work?

FROM dockerfile/java:oracle-java8
VOLUME /tmp
ADD target/core-0.1.0-RELEASE.jar app.jar
RUN bash -c 'touch /app.jar'
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=local","/app.jar"]

It depends on the pom (which you don’t show). Dockerfile ADD works relative to the Dockerfile, so for yours to work you need to copy the jar file to a «target» directory in «target/docker». The maven plugin allows you to do that with a <resources/> element.

I am actually using the IntelliJ to build the Docker Image. So maven is not being used to build the image. Are you saying that this is how the ADD should look? ADD target/core-0.1.0-RELEASE.jar target/app.jar

ok, got it to work.

FROM dockerfile/java:oracle-java8
VOLUME /tmp
ADD target/core-0.1.0-RELEASE.jar target/app.jar
RUN bash -c 'touch target/app.jar'
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=local","target/app.jar"]

Thanks for the pointer on the target I am still learning Docker. Finding it important for working with Spring Cloud at the desktop level.

Same issue! Please help me.

error

I am using Gitlab CI AutoDev tool for build docker image for spring boot app with MySQL.
a build is the success but running» docker-compose up » getting the same issue. It working fine on my local build image. Please help me.

compose.yml

version: '3'

services:
  docker-mysql:
    image: mysql:latest
    environment:
      - MYSQL_ROOT_PASSWORD=12345
      - MYSQL_DATABASE=TechlaviyaDB
      - MYSQL_PASSWORD=12345

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    links:
      - docker-mysql
    environment:
      PMA_HOST: docker-mysql
      PMA_PORT: 3306
    ports:
      - '8081:80'
  docker-webapp:
    image: registry.gitlab.com/techlaviya/techlaviya/master:fb9e0213d6d4f385161e29561e626090a780e517
    depends_on:
      - docker-mysql
    ports:
      - 8080:8080
    environment:
      - DATABASE_HOST=docker-mysql
      - DATABASE_USER=root
      - DATABASE_PASSWORD=12345
      - DATABASE_NAME=TechlaviyaDB
      - DATABASE_PORT=3306

Dockerfile

FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
ADD ${JAR_FILE} TECHLAVIYA.jar
ENTRYPOINT [«java»,»-Djava.security.egd=file:/dev/./urandom»,»-jar»,»/TECHLAVIYA.jar»]

pom

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>

	<groupId>com.techlaviya.lfee</groupId>
	<artifactId>techlaviya</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<packaging>jar</packaging>

	<name>techlaviya</name>
	<description>Demo project for Spring Boot</description>

	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>1.5.8.RELEASE</version>
		<relativePath/> <!-- lookup parent from repository -->
	</parent>

	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
		<java.version>1.8</java.version>
		<start-class>com.techlaviya.lfee.TechlaviyaApplication</start-class>
		<docker.image.prefix>techlaviya</docker.image.prefix>
	</properties>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-devtools</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<scope>runtime</scope>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-test</artifactId>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>com.jayway.jsonpath</groupId>
			<artifactId>json-path</artifactId>
			<scope>test</scope>
		</dependency>


		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger2</artifactId>
			<version>2.4.0</version>
		</dependency>
		<dependency>
			<groupId>io.springfox</groupId>
			<artifactId>springfox-swagger-ui</artifactId>
			<version>2.4.0</version>
		</dependency>


		<dependency>
			<groupId>io.jsonwebtoken</groupId>
			<artifactId>jjwt</artifactId>
			<version>0.6.0</version>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-security</artifactId>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>2.8.9</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.mobile</groupId>
			<artifactId>spring-mobile-device</artifactId>
		</dependency>

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-rest</artifactId>
		</dependency>


	</dependencies>

	<build>
		<finalName>TECHLAVIYA</finalName>
		<plugins>
			<plugin>
				<groupId>org.springframework.boot</groupId>
				<artifactId>spring-boot-maven-plugin</artifactId>
			</plugin>
			<!-- tag::plugin[] -->
			<plugin>
				<groupId>com.spotify</groupId>
				<artifactId>dockerfile-maven-plugin</artifactId>
				<version>1.3.6</version>
				<executions>
					<execution>
						<id>default</id>
						<goals>
							<goal>build</goal>
							<goal>push</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<repository>${docker.image.prefix}/${project.artifactId}</repository>
					<buildArgs>
						<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
					</buildArgs>
				</configuration>


			</plugin>
			<!-- end::plugin[] -->
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<executions>
					<execution>
						<id>unpack</id>
						<phase>package</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<artifactItems>
								<artifactItem>
									<groupId>${project.groupId}</groupId>
									<artifactId>${project.artifactId}</artifactId>
									<version>${project.version}</version>
								</artifactItem>
							</artifactItems>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
	</build>


</project>

For me when I was having the issue, all I did was put the JAR_FILE argument in the pom without the forward slash «/» and it worked.

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>1.2.0</version>
                <configuration>
                    <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
                    <imageTags>
                        <imageTag>${project.version}</imageTag>
                        <imageTag>latest</imageTag>
                    </imageTags>
                    <!-- optionally overwrite tags every time image is built with docker:build -->
                    <forceTags>true</forceTags>
                    <dockerDirectory>src/main/docker</dockerDirectory>
                    <buildArgs>
                        <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                    </buildArgs>
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}</directory>
                            <include>${project.build.finalName}.jar</include>
                        </resource>
                    </resources>
                </configuration>
            </plugin>
        </plugins>
    </build>

Also my Dockerfile is like below


FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]

This issue was closed some time ago and the guide has changed a lot since. If you have a usage question please go to Stack Overflow. If you find an actual bug in the guide sample, then report it here as a separate issue.

FROM ibmjava:8

MAINTAINER «ashish taware»

RUN mkdir -p /var/log/java-web-app

EXPOSE 8080 8081

COPY myjar.jar /opt/aws/

WORKDIR /opt/aws/

CMD [«java», «-jar»,»myjar.jar»]

this is my dockerfile, it built successfully but when i want to run executable JAR the error occurred which is INVALID OR CURRUPT JAR file,

pls help me…

@ashish3016 … I am facing the same issue. Found any solutions?

This is what worked for me:

FROM openjdk:8-jdk-alpine
VOLUME /tmp
ARG JAR_FILE
COPY ${JAR_FILE} app.jar
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
MAINTAINER xxx@gmail.com

The pom.xml build is:

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>1.2.0</version>
                <configuration>
                    <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
                    <imageTags>
                        <imageTag>${project.version}</imageTag>
                        <imageTag>latest</imageTag>
                    </imageTags>
                    <!-- optionally overwrite tags every time image is built with docker:build -->
                    <forceTags>true</forceTags>
                    <dockerDirectory>src/main/docker</dockerDirectory>
                    <buildArgs>
                        <JAR_FILE>${project.build.finalName}.jar</JAR_FILE>
                    </buildArgs>
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}</directory>
                            <include>${project.build.finalName}.jar</include>
                        </resource>
                    </resources>
                </configuration>
            </plugin>
        </plugins>
    </build>

Понравилась статья? Поделить с друзьями:
  • Error invalid operands to binary expression float and float
  • Error invalid operands of types float and int to binary operator
  • Error invalid operands of types double and int to binary operator
  • Error invalid operands of types double and double to binary operator
  • Error invalid operands of types const char and char to binary operator