Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create compact profiles

Tags:

java

java-8

I was googling to find a way to create a Compact profile in Java 1.8 .Is it possible to create a compact profile because Here is saying it is for embedded version only

like image 433
maverick Avatar asked Mar 22 '14 05:03

maverick


Video Answer


1 Answers

Short answer

JEP 161 says that profiles must be in Java 8. They are. To create them, use make profiles

Slightly longer answerr

Your suspicion that profiles may exist on embedded platforms only and comment from @skiwi confused me a bit and I decided to check it myself.

Example with OpenJDK

To check profiles existence I took OpenJDK. I built it on my ubuntu x86 (I read this and this READMEs and process was simple). Instructions say finish with make all command. However, there were not compact profiles after that. Then I read Makefile help section and invoke make profiles. Success

$ hg clone http://hg.openjdk.java.net/jdk8/jdk8
$ cd jdk8
$ bash ./get_source.sh 
$ bash ./configure 
$ make all
$ make profiles

Then I found 'images' directory and went there

$ cd build/linux-x86-normal-server-release/images/
$ export PATH=j2re-compact1-image/bin/:$PATH
$ java -version
openjdk version "1.8.0-internal"
OpenJDK Runtime Environment (build 1.8.0-internal-fasdaq_2014_03_22_20_17-b00, profile compact1)
OpenJDK Server VM (build 25.0-b70, mixed mode)

As you can see from output:

  1. It works
  2. It's not embedded
  3. It's compact1 profile
  4. It's 1.8.0 version

About embedded and link you provided

There is a jrecreate tool that allows you to get jre with profile/vm/extensions you want (and do not include these you don't want).

so that applications that do not require the entire Platform can be deployed and run on small devices (c) jep161

There is no such tool in OpenJDK. Jrecreate is a part of embedded java as you can read from release notes. It's hard question for me: what do you want to reach creating compact profile of non-embedded java. However, you're capable to do it :)

like image 85
Sergey Fedorov Avatar answered Sep 18 '22 17:09

Sergey Fedorov