Skip to content

Commit a253b50

Browse files
authored
How to use with maven
1 parent 0348327 commit a253b50

File tree

1 file changed

+129
-1
lines changed

1 file changed

+129
-1
lines changed

README.md

Lines changed: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ That's all! You will start an example app [ImGuiGlfwExample](https://github.com/
3232

3333
## How to Use
3434

35+
<details>
36+
<summary><b>With Gradle</b></summary>
37+
3538
```
3639
repositories {
3740
jcenter()
@@ -65,8 +68,133 @@ dependencies {
6568
}
6669
}
6770
```
71+
</details>
72+
73+
<details>
74+
<summary><b>With Maven</b></summary>
75+
76+
```
77+
<!-- To properly import imgui-java -->
78+
<repositories>
79+
<repository>
80+
<id>jcenter</id>
81+
<url>https://jcenter.bintray.com/</url>
82+
</repository>
83+
</repositories>
84+
85+
<properties>
86+
<lwjgl.version>3.2.3</lwjgl.version>
87+
<imgui.java.version>1.76-0.10</imgui.java.version>
88+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
89+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
90+
<java.version>1.8</java.version>
91+
<maven.compiler.target>1.8</maven.compiler.target>
92+
<maven.compiler.source>1.8</maven.compiler.source>
93+
</properties>
94+
95+
<!-- Resolves the OS version to use for our natives -->
96+
<profiles>
97+
<profile>
98+
<id>lwjgl-natives-linux-amd64</id>
99+
<activation>
100+
<os>
101+
<family>unix</family>
102+
<arch>amd64</arch>
103+
</os>
104+
</activation>
105+
<properties>
106+
<natives>natives-linux</natives>
107+
</properties>
108+
</profile>
109+
<profile>
110+
<id>lwjgl-natives-windows-amd64</id>
111+
<activation>
112+
<os>
113+
<family>windows</family>
114+
<arch>amd64</arch>
115+
</os>
116+
</activation>
117+
<properties>
118+
<natives>natives-windows</natives>
119+
</properties>
120+
</profile>
121+
<profile>
122+
<id>lwjgl-natives-windows-x86</id>
123+
<activation>
124+
<os>
125+
<family>windows</family>
126+
<arch>x86</arch>
127+
</os>
128+
</activation>
129+
<properties>
130+
<natives>natives-windows-x86</natives>
131+
</properties>
132+
</profile>
133+
</profiles>
134+
135+
<dependencyManagement>
136+
<dependencies>
137+
<dependency>
138+
<groupId>org.lwjgl</groupId>
139+
<artifactId>lwjgl-bom</artifactId>
140+
<version>${lwjgl.version}</version>
141+
<scope>import</scope>
142+
<type>pom</type>
143+
</dependency>
144+
</dependencies>
145+
</dependencyManagement>
146+
147+
<dependencies>
148+
<!-- imgui-java -->
149+
<dependency>
150+
<groupId>io.imgui.java</groupId>
151+
<artifactId>binding</artifactId>
152+
<version>${imgui.java.version}</version>
153+
</dependency>
154+
<dependency>
155+
<groupId>io.imgui.java</groupId>
156+
<artifactId>lwjgl3</artifactId>
157+
<version>${imgui.java.version}</version>
158+
</dependency>
159+
<dependency>
160+
<groupId>io.imgui.java</groupId>
161+
<artifactId>${natives}</artifactId>
162+
<version>${imgui.java.version}</version>
163+
</dependency>
164+
165+
<!-- LWJGL -->
166+
<dependency>
167+
<groupId>org.lwjgl</groupId>
168+
<artifactId>lwjgl</artifactId>
169+
</dependency>
170+
<dependency>
171+
<groupId>org.lwjgl</groupId>
172+
<artifactId>lwjgl-glfw</artifactId>
173+
</dependency>
174+
<dependency>
175+
<groupId>org.lwjgl</groupId>
176+
<artifactId>lwjgl-opengl</artifactId>
177+
</dependency>
178+
<dependency>
179+
<groupId>org.lwjgl</groupId>
180+
<artifactId>lwjgl</artifactId>
181+
<classifier>${natives}</classifier>
182+
</dependency>
183+
<dependency>
184+
<groupId>org.lwjgl</groupId>
185+
<artifactId>lwjgl-glfw</artifactId>
186+
<classifier>${natives}</classifier>
187+
</dependency>
188+
<dependency>
189+
<groupId>org.lwjgl</groupId>
190+
<artifactId>lwjgl-opengl</artifactId>
191+
<classifier>${natives}</classifier>
192+
</dependency>
193+
</dependencies>
194+
```
195+
</details>
68196

69-
Alternatively you can download imgui-java binaries manually from the [release page](https://github.com/SpaiR/imgui-java/releases/latest). You'll need to provide a VM option: `imgui.library.path` or `java.library.path`. It should point to the folder where you've placed downloaded binaries.
197+
You can download imgui-java manually from the [release page](https://github.com/SpaiR/imgui-java/releases/latest). For the natives to work you'll need to provide a VM option: `imgui.library.path` or `java.library.path`. It should point to the folder where you've placed downloaded binaries.
70198

71199
**You are ready to use imgui-java binding!**
72200

0 commit comments

Comments
 (0)