How to run minecraft on your PC (Java version) - note, Java edition does not support cross platform:
https://www.h3xed.com/pc-gaming/start-a-minecraft-server-and-play-with-your-friends
To check your external ip:
https://www.whatismyip.com/
To check if your port is open:
https://www.yougetsignal.com/tools/open-ports/
Thursday, April 23, 2020
Tuesday, April 21, 2020
Sunday, April 19, 2020
Very good reference on using Jersey:
https://dennis-xlc.gitbooks.io/restful-java-with-jax-rs-2-0-en/cn/part1/chapter8/building_and_invoking_requests.html
Do note: need to do a string:
Response resp = invocationBuilder.post(Entity.entity(jsonObjectBody.toString(), MediaType.APPLICATION_JSON));
or else json
{"method":"Logon","payload":{"strLogin":"aaa_offers","strPassword":"gL(8KKw3L)\\\"g)BKR","elemParameters":{}},"schema":"xtk:session","securityToken":"","sessionToken":""}
will be converted to like NVP:
https://dennis-xlc.gitbooks.io/restful-java-with-jax-rs-2-0-en/cn/part1/chapter8/building_and_invoking_requests.html
Do note: need to do a string:
Response resp = invocationBuilder.post(Entity.entity(jsonObjectBody.toString(), MediaType.APPLICATION_JSON));
or else json
{"method":"Logon","payload":{"strLogin":"aaa_offers","strPassword":"gL(8KKw3L)\\\"g)BKR","elemParameters":{}},"schema":"xtk:session","securityToken":"","sessionToken":""}
will be converted to like NVP:
{
"method": {
"chars": "Logon",
"string": "Logon",
"valueType": "STRING"
},
"payload": {
"strLogin":
{
"chars": "aaa_offers",
"string": "aaa_offers",
"valueType": "STRING"
},
"strPassword": {
"chars": "**** password here ****",
"string": "**** password here ****",
"valueType": "STRING"
},
"elemParameters": {}
},
"schema": {
"chars": "xtk:session",
"string": "xtk:session",
"valueType": "STRING"
},
"securityToken": {
"chars": "",
"string": "",
"valueType": "STRING"
},
"sessionToken": {
"chars": "",
"string": "",
"valueType": "STRING"
}
}
Saturday, April 18, 2020
Jersey Logging
Not easy to do with Jersey 2 but here's a good one to start with:
https://www.javaguides.net/2018/06/jersey-rest-logging-using-loggingfeature.html
And here is how to bridge it to log4j:
https://stackoverflow.com/questions/15437043/how-to-use-log4j-to-see-into-jersey
https://xiaozhoutech.wordpress.com/2013/08/02/log4j-working-on-jersey/
http://jersey.576304.n2.nabble.com/Enable-Logging-td7581002.html
OK folks, this one works:
https://www.logicbig.com/tutorials/misc/java-logging/jul-to-slf4j-log4j2.html
Will post code later
https://www.javaguides.net/2018/06/jersey-rest-logging-using-loggingfeature.html
And here is how to bridge it to log4j:
https://stackoverflow.com/questions/15437043/how-to-use-log4j-to-see-into-jersey
https://xiaozhoutech.wordpress.com/2013/08/02/log4j-working-on-jersey/
http://jersey.576304.n2.nabble.com/Enable-Logging-td7581002.html
OK folks, this one works:
https://www.logicbig.com/tutorials/misc/java-logging/jul-to-slf4j-log4j2.html
Will post code later
Getting started on Maven
Trying this out now, coz I realised this is the easiest way to ensure I am using the latest jars that I need for my development work.
See this for starters: https://www.vogella.com/tutorials/EclipseMaven/article.html
If you get the error "maven could not resolve archetype", try the suggestions in these 2 links:
https://stackoverflow.com/questions/15506043/create-a-maven-project-in-eclipse-complains-could-not-resolve-archetype
https://stackoverflow.com/questions/18499931/eclipse-java-ee-new-maven-project-could-not-resolve-archetype
To setup Eclipse with M2E:
See this for starters: https://www.vogella.com/tutorials/EclipseMaven/article.html
If you get the error "maven could not resolve archetype", try the suggestions in these 2 links:
https://stackoverflow.com/questions/15506043/create-a-maven-project-in-eclipse-complains-could-not-resolve-archetype
https://stackoverflow.com/questions/18499931/eclipse-java-ee-new-maven-project-could-not-resolve-archetype
To setup Eclipse with M2E:
Way 1: Maven Eclipse plugin installation step by step:
- Open Eclipse IDE
- Click Help -> Install New Software...
- Click Add button at top right corner
- At pop up: fill up Name as "M2Eclipse" and Location as "http://download.eclipse.org/technology/m2e/releases" or http://download.eclipse.org/technology/m2e/milestones/1.0
- Now click OK
After that installation would be started.
Way 2: Another way to install Maven plug-in for Eclipse by "Eclipse Marketplace":
- Open Eclipse
- Go to Help -> Eclipse Marketplace
- Search by Maven
- Click "Install" button at "Maven Integration for Eclipse" section
- Follow the instruction step by step
After successful installation do the followings in Eclipse:
- Go to Window --> Preferences
- Observe, Maven is enlisted at left panel
Finally,
- Click on an existing project
- Select Configure -> Convert to Maven Project
Subscribe to:
Posts (Atom)