https://github.com/perrywerneck/tn3270-java
JNI Module for lib3270/pw3270
https://github.com/perrywerneck/tn3270-java
Last synced: about 2 months ago
JSON representation
JNI Module for lib3270/pw3270
- Host: GitHub
- URL: https://github.com/perrywerneck/tn3270-java
- Owner: PerryWerneck
- License: lgpl-3.0
- Created: 2019-04-26T14:03:51.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-06-02T07:35:26.000Z (about 3 years ago)
- Last Synced: 2025-01-01T21:46:23.039Z (over 1 year ago)
- Language: C++
- Homepage:
- Size: 209 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# Java tn3270 protocol library
Java class for interaction with pw3270 or lib3270.
[](https://www.gnu.org/licenses/gpl-3.0)

[](https://build.opensuse.org/package/show/home:PerryWerneck:pw3270/tn3270-java)
## Instalation
### Linux
[
](https://software.opensuse.org/download.html?project=home%3APerryWerneck%3Apw3270&package=tn3270-java)
### Windows
The jar and zip files for windows can be found on [Releases](../../releases)
## Examples
Getting versions of jni module and loaded lib3270
```java
import br.app.pw3270.Terminal;
public class Sample {
public static void main (String[] args) {
try (Terminal host = new Terminal()) {
System.out.println("Using ipc3270 version " + host.getVersion() + "-" + host.getRevision());
System.out.println("Using lib3270 version " + host.getLib3270Version() + "-" + host.getLib3270Revision());
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
Get pw3270's session contents
```java
import br.app.pw3270.Terminal;
public class Sample {
public static void main (String[] args) {
try (Terminal host = new Terminal(":a")) {
host.setCharSet("UTF-8");
if(!host.getConnected()) {
System.out.println("Connecting to host");
host.connect(20);
}
if(!host.getConnected()) {
System.out.println("The host is not connected");
} else if(!host.getReady()) {
System.out.println("The host is not ready");
} else {
System.out.println(host.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
```
## Building for Linux
### Requirements
* [libipc3270](../../../libipc3270)
## Building for windows
### Windows native with MSYS2
1. Install java sdk
2. Get the latest protocol library release for mingw: [mingw-lib3270.tar.xz](../../../lib3270/releases)
3. Get the latest 'glue' library release for mingw: [mingw-libipc3270.tar.xz](../../../libipc3270/releases)
4. Install the required libraries on mingw shell
```shell
tar -C / -Jxvf mingw-lib3270.tar.xz
tar -C / -Jxvf mingw-libipc3270.tar.xz
```
3. Get sources from git
```shell
git clone https://github.com/PerryWerneck/tn3270-java.git ./tn3270-java
```
4. Build package using the mingw shell
```shell
cd tn3270-java
./autogen.sh
make all
```
5. Make jar
```shell
make package
```