Like Nick mentioned if you are looking for a Java-based solution you'd have to use the Core Service API. The set up is pretty straight forward.
First, create a Java proxy client from the WSDL (e.g., if you are using 8.5 you'd use the WSDL at http://SERVER:PORT/webservices/CoreService201603.svc?wsdl.) The steps for creating the proxy are described here: https://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v5/GUID-CF2ABF27-2D1C-4342-9635-2DFD7A6D4D42.
Creating the proxy will create all the required classes for interacting with the Core Service API. Just include these generated classes in your Java classpath of your client and you should be able to create categories and publish them.
To create a category:
CoreService201603 coreService = new CoreService201603();
ICoreService coreServiceClient = coreService.getBasicHttp();
// "tcm:0-150-1" is the publication ID where the category is to be created.
CategoryData categoryData = (CategoryData)coreServiceClient.getDefaultData(ItemType.CATEGORY,
"tcm:0-150-1", new ReadOptions());
categoryData.getTitle().setValue("Category 1");
categoryData.getXmlName().setValue("category1");
IdentifiableObjectData category = coreServiceClient.create(categoryData, new ReadOptions());
The question here about How to publish a component using SDL Core Services in Java? should help you publish the created categories.
The full Core Service API documentation is available for download here: https://docs.sdl.com/LiveContent/content/en-US/SDL%20Web-v5/GUID-2301148A-E3EA-43EF-A2FC-7D3C9BAEE8FF.
Hope this helps.