Error invalid or corrupt jarfile choros jar

After adding the Maven jFree dependency to my existing application, I'm not able to execute the created jar. The only error message I get is the following: java -jar target/com.company.product-1...

On my end if I build your project using the pom.xml you’ve showed us, with apache-poi declared after jfreechart, then as you’ve mentioned I get a corrupt JAR. Swapping the order of these two dependencies indeed gives me a correct JAR.

I’ve some previous experience with the maven-shade-plugin and when I used it I had trouble with the created JAR’s META-INF directory, so I’ve checked that for defects.

I’ve tried to copy (using Total Commander) the META-INF directory somewhere on my local filesystem and what I’ve noticed is that there were errors while copying the files in META-INF/licences/. If I’ve tried to copy those somewhere individually and it worked but I couldn’t copy the whole thing. My conclusion was that the JAR/ZIP archive is corrupt.

What I did was I entered that JAR in Total Commander (Ctrl+PgDown over the JAR file) and I renamed thirdpartylicenses.txt to thirdpartylicenses.txt.wtf. Doing this Total Commander offers to save this and it repackages the JAR (I’ve the Total7zip Total Commander packer plugin installed — if anyone tries this and it doesn’t work try it with this installed).

After this. It works.

(I’ve also tried to repack the whole thing without renaming anything using Cygwin’s unzip/zip commands, but that didn’t work the new archive was still corrupt. Total Commander or the plugin I’ve mentioned does some magic.)

I guess the maven-shade-plugin merely creates a corrupt or invalid ZIP/JAR archive. I’m not sure why and maybe what I’ve described won’t work for anyone else but I thought I’d mention it so maybe I could help.


I couldn’t just leave this alone, so I’ve dug deeper and I think I’ve found the answer.

The bad JAR contains 65608 entries.
The good JAR contains 65450 entries.

Guess what’s the upper limit of the number of entries for a plain ZIP file? Yeah. The Wiki article speaks about a ZIP64 format which overcomes this limitation.

The good JAR has less entries because the actual dependencies change because of the position of the dependency declarations in your pom.xml. (As described by this answer.)

I’ve counted the entries like this.

Collections.list(new JarFile("...").entries()).size();

I was using Java 7 which seems to support the new ZIP64 format, so maybe if someone tries to count the entries in the bad JAR using Java 5 or 6 will receive an error (I’m not sure though).

I also tried to run the JAR exploded. I’ve unpacked the whole JAR into a directory and run the whole thing like this.

java -cp <dir/ com.mycompany.test.Start

Worked like a charm.


Bottom line. Don’t overuse the maven-shade-plugin.

I have a project at work where I build my project like this.

  • I copy my project’s dependencies using the maven-dependency-plugin. Checkout the copy-dependencies goal. This copies your dependencies into target/dependency if I remember correctly.
  • Using the maven-jar-plugin I add these dependencies to my final JAR’s MANIFEST.MF as Class-Path entries using these options in the plugins configuration.

    <classpathPrefix>dependency/</classpathPrefix>
    <addClasspath>true</addClasspath>
    

    So I’ll have Class-Path entries like dependency/<artifactId>-<version>.jar, etc.

  • After this I’m using the maven-assembly-plugin to create a distribution ZIP which contains my final JAR and the whole dependency/ folder.
  • When I deploy my application I can run it like java -jar final.jar.

Primarily I’ve opted to use this solution, because in my project I use some Bouncy Castle JARs which JARs have some extravagant this and that inside their META-INF directory. When I used the maven-shade-plugin to create my final runnable JAR all hell broke loose and I got nasty that method couldn’t be found and this signature is not quite right errors.

You should be doing something like this also. This Maven shade business is too shady to be useful (pun intended).


Here’s a blog post on the whole process that I’ve tried to describe just above (thanks to
baba), maybe it’ll help someone in the future.

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.

Данная публикация посвящается всем ценителям 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.

Источник

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>

If you can’t install Minecraft Forge because of the invalid or corrupt jarfile error, keep on reading this guide to learn what might have caused it and how you can fix it.

1. Make sure the download is complete

If you’re trying to launch the game before the download is complete, you’ll get all sorts of errors, including the invalid or corrupt jarfile error.

Make sure Minecraft Forge is showing up in your downloads folder. Then, check if your browser is not blocking it for some reason.

Go to your browser’s download manager, recover the file and try again.

2. Use a different browser

Many of the users who complained about invalid or corrupt jarfile errors in Minecraft used Firefox to download the game.

It seems that Firefox often blocks the Minecraft Forge download. That’s why we suggest you should try to download the game using a different browser.

3. Update your Java version

Ensure you’re running the latest Java version on your computer. Download a newer version if you’re running an outdated version.

4. Close background programs

When downloading Minecraft Forge, or any other game or program on your computer, remember to close all the programs and processes running in the background.

Some of the programs actively running on your machine might block the download process. Or they may interfere with Minecraft Forge when you try to load the launcher.

You can close background programs using the Task Manager or by clean booting your computer.

If you prefer to use the Task Manager, select the Processes tab and right-click on the programs you want to disable. Then select End Task.

You can also temporarily disable your antivirus and firewall. These programs might mistakenly flag certain Minecraft files as suspicious and block them.

Don’t forget to re-enable your antivirus and firewall after you downloaded and installed Minecraft Forge.

We hope something helps.

Понравилась статья? Поделить с друзьями:
  • 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