Java - CodeName One: not finding symbole fileInput/Output - java

I'm trying to copy an image with java in a codename One project , this is the code which gives correct copy of the image:
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.mycompany.gui;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
/**
*
* #author Emel
*/
public class NewMain {
/**
* #param args the command line arguments
*/
public static void main(String[] args)
throws FileNotFoundException, IOException
{
// TODO code application logic here
InputStream is = null;
OutputStream os = null;
is = new FileInputStream(new File("C:/Users/Emel/AppData/Local/Temp/temp8255862222083205111..png"));
os = new FileOutputStream(new File("C:/wamp64/www/PiWeb1/TeamFlags/mpmppp.png"));
byte[] buffer = new byte[1024];
int length;
while ((length = is.read(buffer)) > 0) {
os.write(buffer, 0, length);
}
}
}
the code works perfectly when i put it in a main java class (it only works when i run the mainclass ) but when i build the project the build fails and the output show this error :
`C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompany\gui\NewMain.java:8:
error: cannot find symbol import java.io.File; symbol: class File
location: package java.io
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompany\gui\NewMain.java:9:
error: cannot find symbol import java.io.FileInputStream; symbol:
class FileInputStream location: package java.io
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompany\gui\NewMain.java:10:
error: cannot find symbol import java.io.FileNotFoundException;
symbol: class FileNotFoundException location: package java.io
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompany\gui\NewMain.java:11:
error: cannot find symbol import java.io.FileOutputStream; symbol:
class FileOutputStream location: package java.io
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompany\gui\NewMain.java:25:
error: cannot find symbol
throws FileNotFoundException, IOException symbol: class FileNotFoundException location: class NewMain
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompagny\Service\ServiceEquipe.java:38:
error: cannot find symbol
is = new FileInputStream("C:/Users/Emel/AppData/Local/Temp/temp8255862222083205111..png");
symbol: class FileInputStream location: class ServiceEquipe
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompagny\Service\ServiceEquipe.java:39:
error: cannot find symbol
os = new FileOutputStream( symbol: class FileOutputStream location: class ServiceEquipe
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompany\gui\NewMain.java:31:
error: cannot find symbol
is = new FileInputStream(new File("C:/Users/Emel/AppData/Local/Temp/temp8255862222083205111..png"));
symbol: class FileInputStream location: class NewMain
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompany\gui\NewMain.java:31:
error: cannot find symbol
is = new FileInputStream(new File("C:/Users/Emel/AppData/Local/Temp/temp8255862222083205111..png"));
symbol: class File location: class NewMain
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompany\gui\NewMain.java:32:
error: cannot find symbol
os = new FileOutputStream(new File("C:/wamp64/www/PiWeb1/TeamFlags/mpmppp.png")); symbol: class
FileOutputStream location: class NewMain
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompany\gui\NewMain.java:32:
error: cannot find symbol
os = new FileOutputStream(new File("C:/wamp64/www/PiWeb1/TeamFlags/mpmppp.png")); symbol: class
File location: class NewMain Note:
C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompagny\Service\ServiceEquipe.java
uses or overrides a deprecated API. Note: Recompile with
-Xlint:deprecation for details. Note: C:\Users\Emel\Documents\NetBeansProjects\PIMOBILE\Mobile\src\com\mycompagny\Service\ServiceEquipe.java
uses unchecked or unsafe operations. Note: Recompile with
-Xlint:unchecked for details. 11 errors
`
Now i need to put that code block into a method to recall it, i tried to do that in different ways but i failed it only works when i use it in a main class.
PS1: when i delete that main class from my project the build succeed.
PS2: the solution works perfectly in a normal java project so i think the problem is due to codename One.
Im using netbeans.

java.io.File, java.io.FileInputStream, java.io.FileNotFoundException &
java.io.FileOutputStream don't exist in Codename One.
There is a long explanation here.
There are several reasons but these specific API's won't act correctly on a mobile device where your app needs to run in isolation from other processes and has limited/restricted access. E.g. in your case it's pretty obvious the C: path won't exist on Android or iOS both of which are Unix derivatives (Linux/BSD).
You need to use FileSystemStorage or Storage there is a section about those in the developer guide.

Related

Execution failed for task ':compileJava'. - Issue 3 in this series

Before this question gets closed for already being asked, as far as I can see it is a vague and common error so this is different from other questions.
I fixed the error in my previous post by installing a slightly different version of Forge, but have now reached Step 5 of this tutorial. When I use .\gradlew build with the example mod, everything seems to work fine (although I cannot find the console output) But when I edit the mod to how the author describes, I get many errors.
The example mod:
package com.example.examplemod;
import net.minecraft.init.Blocks;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
#Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
public class ExampleMod
{
public static final String MODID = "examplemod";
public static final String VERSION = "1.0";
#EventHandler
public void init(FMLInitializationEvent event)
{
// some example code
System.out.println("DIRT BLOCK >> "+Blocks.dirt.getUnlocalizedName());
}
}
How I changed it, following the tutorial:
package com.example.examplemod;
import net.minecraft.init.Blocks;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
#Mod(modid = ExampleMod.MODID, version = ExampleMod.VERSION)
public class ExampleMod
{
public static final String MODID = "examplemod";
public static final String VERSION = "1.1";
#EventHandler
public void init(FMLInitializationEvent event)
{
Block amethystOre = new ModBlock(Material.rock, "amethystOre");
GameRegistry.registerBlock(amethystOre, "amethystOre");
}
private class ModBlock extends Block
{
public ModBlock(Material material, String blockName)
{
super(material);
this.setBlockName(blockName);
this.setBlockTextureName(MODID + ":" + blockName);
this.setCreativeTab(CreativeTabs.tabBlock);
}
}
}
When I run .\gradlew build, I get:
#################################################
ForgeGradle 1.2-SNAPSHOT-fb514d3
https://github.com/MinecraftForge/ForgeGradle
#################################################
Powered by MCP unknown
http://modcoderpack.com
by: Searge, ProfMobius, Fesh0r,
R4wk, ZeuX, IngisKahn, bspkrs
#################################################
:compileApiJava UP-TO-DATE
:processApiResources UP-TO-DATE
:apiClasses UP-TO-DATE
:sourceMainJava UP-TO-DATE
:compileJava
warning: [options] bootstrap class path not set in conjunction with -source 1.6
C:\Users\benji\MinecraftWorkspace\forge-1.7.10-10.13.4.1558-1.7.10-src\build\sources\java\com\example\examplemod\ExampleMod.java:21: error: cannot find symbol
private class ModBlock extends Block
^
symbol: class Block
location: class ExampleMod
C:\Users\benji\MinecraftWorkspace\forge-1.7.10-10.13.4.1558-1.7.10-src\build\sources\java\com\example\examplemod\ExampleMod.java:23: error: cannot find symbol
public ModBlock(Material material, String blockName)
^
symbol: class Material
location: class ExampleMod.ModBlock
C:\Users\benji\MinecraftWorkspace\forge-1.7.10-10.13.4.1558-1.7.10-src\build\sources\java\com\example\examplemod\ExampleMod.java:17: error: cannot find symbol
Block amethystOre = new ModBlock(Material.rock, "amethystOre");
^
symbol: class Block
location: class ExampleMod
C:\Users\benji\MinecraftWorkspace\forge-1.7.10-10.13.4.1558-1.7.10-src\build\sources\java\com\example\examplemod\ExampleMod.java:17: error: cannot find symbol
Block amethystOre = new ModBlock(Material.rock, "amethystOre");
^
symbol: variable Material
location: class ExampleMod
C:\Users\benji\MinecraftWorkspace\forge-1.7.10-10.13.4.1558-1.7.10-src\build\sources\java\com\example\examplemod\ExampleMod.java:18: error: cannot find symbol
GameRegistry.registerBlock(amethystOre, "amethystOre");
^
symbol: variable GameRegistry
location: class ExampleMod
C:\Users\benji\MinecraftWorkspace\forge-1.7.10-10.13.4.1558-1.7.10-src\build\sources\java\com\example\examplemod\ExampleMod.java:26: error: cannot find symbol
this.setBlockName(blockName);
^
symbol: method setBlockName(String)
C:\Users\benji\MinecraftWorkspace\forge-1.7.10-10.13.4.1558-1.7.10-src\build\sources\java\com\example\examplemod\ExampleMod.java:27: error: cannot find symbol
this.setBlockTextureName(MODID + ":" + blockName);
^
symbol: method setBlockTextureName(String)
C:\Users\benji\MinecraftWorkspace\forge-1.7.10-10.13.4.1558-1.7.10-src\build\sources\java\com\example\examplemod\ExampleMod.java:28: error: cannot find symbol
this.setCreativeTab(CreativeTabs.tabBlock);
^
symbol: variable CreativeTabs
location: class ExampleMod.ModBlock
8 errors
1 warning
:compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
I don't know a whole lot about Java (I just started learning it) but I would assume that copying the tutorial character-for-character should result in an error-free program. Apparently not.
Looking at the error output on the compiler, the first error is 'The import net cannot be resolved' (line 3) I don't know why though.
Any help is much appreciated,
Ben
(From comment)
Import are wrong. You should use net.minecraft.* not net.minecraft.init.* :
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;

Error: package android.util does not exist

I am trying to compile my java code, so I first convert it to .class, then to .dex and finally to smali, this has always worked, except for now as I am using the method Log.e() instead of System.out.println() to log some errors; I am unable to convert the .java file to .class.
This is the command I launch to get the .class file:
$ javac helloworld.java
Even though I've imported the library import android.util.Log;
I get the following Error:
sources/com/canal/android/external/CplusJni.java:9: error: package android.util does not exist
import android.util.Log;
^
sources/com/canal/android/external/CplusJni.java:25: error: cannot find symbol
Log.e("-----------------------------------------------------------------------------");
^
symbol: variable Log
location: class CplusJni
sources/com/canal/android/external/CplusJni.java:26: error: cannot find symbol
Log.e("cplusPKCS12Cert: ",cplusPKCS12Cert);
^
symbol: variable Log
location: class CplusJni
sources/com/canal/android/external/CplusJni.java:27: error: cannot find symbol
Log.e("-----------------------------------------------------------------------------");
^
symbol: variable Log
location: class CplusJni
sources/com/canal/android/external/CplusJni.java:35: error: cannot find symbol
Log.e("-----------------------------------------------------------------------------");
^
symbol: variable Log
location: class CplusJni
sources/com/canal/android/external/CplusJni.java:36: error: cannot find symbol
Log.e("sSLSocketFactory: ",sSLSocketFactory);
^
symbol: variable Log
location: class CplusJni
sources/com/canal/android/external/CplusJni.java:37: error: cannot find symbol
Log.e("-----------------------------------------------------------------------------");
^
symbol: variable Log
location: class CplusJni
7 errors
Here is my code:
package com.canal.android.external;
import java.io.ByteArrayInputStream;
import java.security.KeyStore;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import android.util.Log;`
public class CplusJni {
public static native byte[] getCplusPKCS12Cert();
public static native byte[] getCplusPKCS12Pass();
static {
System.loadLibrary("cplusnative");
}
public static SSLSocketFactory a() {
SSLSocketFactory sSLSocketFactory = null;
try {
SSLContext instance = SSLContext.getInstance("TLS");
byte[] cplusPKCS12Cert = getCplusPKCS12Cert();
Log.e("-----------------------------------------------------------------------------");
Log.e("cplusPKCS12Cert: ",cplusPKCS12Cert);
Log.e("-----------------------------------------------------------------------------");
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(cplusPKCS12Cert);
KeyStore instance2 = KeyStore.getInstance("PKCS12");
byteArrayInputStream.close();
KeyManagerFactory instance3 = KeyManagerFactory.getInstance("X509");
instance.init(instance3.getKeyManagers(), null, null);
HttpsURLConnection.setDefaultSSLSocketFactory(instance.getSocketFactory());
sSLSocketFactory = instance.getSocketFactory();
Log.e("-----------------------------------------------------------------------------");
Log.e("sSLSocketFactory: ",sSLSocketFactory);
Log.e("-----------------------------------------------------------------------------");
return sSLSocketFactory;
} catch (Exception unused) {
return sSLSocketFactory;
}
}
}
I would appreciate some help with this!
try to solve it this way
Step by step:
1- Open Auto Import settings
2- Switch off Optimize imports on the fly
3- Remove class in Exclude list

Java Tesseract dyld: Symbol not found:

im trying to do simple OCR application but i get errors like this:
Code:
import org.bytedeco.javacpp.*;
import static org.bytedeco.javacpp.lept.*;
import static org.bytedeco.javacpp.tesseract.*;
import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.UnsupportedEncodingException;
public class Main {
public void tesseract(String filename){
BytePointer outText;
tesseract.TessBaseAPI api = new tesseract.TessBaseAPI();
// Initialize tesseract-ocr with English, without specifying tessdata path
if (api.Init("/Users/Marcel/tesseract-ocr", "ENG") != 0) {
System.err.println("Could not initialize tesseract.");
System.exit(1);
}
// Open input image with leptonica library
PIX image = pixRead(filename);
api.SetImage(image);
// Get OCR result
outText = api.GetUTF8Text();
String string = outText.getString();
assertTrue(!string.isEmpty());
System.out.println("OCR output:\n" + string);
// Destroy used object and release memory
api.End();
outText.deallocate();
pixDestroy(image);
}
public static void main(String[] args) {
Main main = new Main();
String fileName = "src/main/resources/test.png";
main.tesseract(fileName);
}
}
I have tried some solutions from google, but it didnt solve this. I using Inteliji (with maven) on Mac OSX. Before i had problem with TESTDATA_PREFIX, but i changed api.init first parameter and now i get this:
dyld: lazy symbol binding failed: Symbol not found: __ZN9tesseract11TessBaseAPI8SetImageEPK3Pix
Referenced from: /private/var/folders/lq/3mb8s_jj1ql0klqzznm1j1tm0000gn/T/javacpp33697284992581/libjnitesseract.dylib
Expected in: /usr/local/lib/libtesseract.3.dylib
dyld: Symbol not found: __ZN9tesseract11TessBaseAPI8SetImageEPK3Pix
Referenced from: /private/var/folders/lq/3mb8s_jj1ql0klqzznm1j1tm0000gn/T/javacpp33697284992581/libjnitesseract.dylib
Expected in: /usr/local/lib/libtesseract.3.dylib
This is because of 2 conflicting libtesseract.3.dylib.
If you have installed tesseract on mac using brew then it is referring to the libtesseract.3.dylib inside tesseract folder /usr/local/Cellar/tesseract/3.04.01_1/lib/
instead of /usr/local/lib/libtesseract.3.dylib

How to properly compile this file using javac

I have the following file called Test.Java the code of which is
package example25;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.Iterator;
import org.jibx.runtime.BindingDirectory;
import org.jibx.runtime.IBindingFactory;
import org.jibx.runtime.IMarshallingContext;
import org.jibx.runtime.IUnmarshallingContext;
import org.jibx.runtime.JiBXException;
public class Test
{
public static void main(String[] args)
{
try
{
// unmarshal customer information from file
IBindingFactory bfact = BindingDirectory.getFactory(Order.class);
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
FileInputStream in = new FileInputStream("D:\\Java Libraries\\jibx\\dwcode2\\starter.xml");
Order order = (Order)uctx.unmarshalDocument(in, null);
// compute the total amount of the order
float total = 0.0f;
for (Iterator<Item> iter = order.getItemList().iterator(); iter.hasNext();)
{
Item item = iter.next();
total += item.getPrice() * item.getQuantity();
}
order.setTotal(new Float(total));
// marshal object back out to file (with nice indentation, as UTF-8)
IMarshallingContext mctx = bfact.createMarshallingContext();
mctx.setIndent(2);
FileOutputStream out = new FileOutputStream("c:\\out.xml");
mctx.setOutput(out, null);
mctx.marshalDocument(order);
System.out.println("Processed order with " + order.getItemList().size() + " items and total value " + total);
}
catch (FileNotFoundException e)
{
e.printStackTrace();
System.exit(1);
} catch (JiBXException e)
{
e.printStackTrace();
System.exit(1);
}
}//end main
}//end class
Here is how i am trying to compile this file and the output that i get
C:\jibx\tutorial>javac example25\Test.java
example25\Test.java:8: error: package org.jibx.runtime does not exist
import org.jibx.runtime.BindingDirectory;
^
example25\Test.java:9: error: package org.jibx.runtime does not exist
import org.jibx.runtime.IBindingFactory;
^
example25\Test.java:10: error: package org.jibx.runtime does not exist
import org.jibx.runtime.IMarshallingContext;
^
example25\Test.java:11: error: package org.jibx.runtime does not exist
import org.jibx.runtime.IUnmarshallingContext;
^
example25\Test.java:12: error: package org.jibx.runtime does not exist
import org.jibx.runtime.JiBXException;
^
example25\Test.java:25: error: cannot find symbol
IBindingFactory bfact = BindingDirectory.getFactory(Order.class);
^
symbol: class IBindingFactory
location: class Test
example25\Test.java:25: error: cannot find symbol
IBindingFactory bfact = BindingDirectory.getFactory(Order.class);
^
symbol: variable BindingDirectory
location: class Test
example25\Test.java:26: error: cannot find symbol
IUnmarshallingContext uctx = bfact.createUnmarshallingContext();
^
symbol: class IUnmarshallingContext
location: class Test
example25\Test.java:40: error: cannot find symbol
IMarshallingContext mctx = bfact.createMarshallingContext();
^
symbol: class IMarshallingContext
location: class Test
example25\Test.java:52: error: cannot find symbol
} catch (JiBXException e)
^
symbol: class JiBXException
location: class Test
10 errors
All the class files used by Test are present next to it and have been properly compiled.
Test is the last file that is giving me trouble. Furthermore some of the classes used in test are present in C:\jibx\lib> as opposed to C:\jibx\tutorial> from where i am executing commands. Any suggestions on how i cld resolve this issue without modifying my previously generated class files would be appreciated.
add the directory C:\jibx\lib to your classpath e.g.
SET CLASSPATH=%CLASSPATH%;C:\jibx\lib;.
and then do a javac
As there are some import errors set the class path properly as Satya said, And the your current class in some directory you should compile it with -d attribute of javac
As shown below
javac -d . YourfileName.java

Cannot find Package fop ( Ithink)

Hello friends I try to use fop engine programatically I search for an example and I find this class
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.TransformerException;
import javax.xml.transform.Source;
import javax.xml.transform.Result;
import javax.xml.transform.stream.StreamSource;
import javax.xml.transform.sax.SAXResult;
import org.apache.avalon.framework.ExceptionUtil;
import org.apache.avalon.framework.logger.ConsoleLogger;
import org.apache.avalon.framework.logger.Logger;
import org.apache.fop.apps.Driver;
import org.apache.fop.apps.FOPException;
import org.apache.fop.messaging.MessageHandler;
public class Invokefop
{
public void convertXML2PDF(File xml, File xslt, File pdf)
throws IOException, FOPException, TransformerException {
Driver driver = new Driver();
Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);
driver.setLogger(logger);
MessageHandler.setScreenLogger(logger);
driver.setRenderer(Driver.RENDER_PDF);
OutputStream out = new java.io.FileOutputStream(pdf);
try {
driver.setOutputStream(out);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(new StreamSource(xslt));
Source src = new StreamSource(xml);
Result res = new SAXResult(driver.getContentHandler());
transformer.transform(src, res);
} finally {
out.close();
}
}
public static void main(String[] args) {
try {
System.out.println("JAVA XML2PDF:: FOP ExampleXML2PDF\n");
System.out.println("JAVA XML2PDF:: Preparing...");
File base = new File("../");
File baseDir = new File(base, "in");
File outDir = new File(base, "out");
outDir.mkdirs();
File xmlfile = new File(baseDir, args[0]);
File xsltfile = new File(baseDir, args[1]);
File pdffile = new File(outDir, args[2]);
System.out.println("JAVA XML2PDF:: Input: XML (" + xmlfile + ")");
System.out.println("JAVA XML2PDF:: Stylesheet: " + xsltfile);
System.out.println("JAVA XML2PDF:: Output: PDF (" + pdffile + ")");
System.out.println();
System.out.println("JAVA XML2PDF:: Transforming...");
Invokefop app = new Invokefop();
app.convertXML2PDF(xmlfile, xsltfile, pdffile);
System.out.println("JAVA XML2PDF:: Success!");
} catch (Exception e) {
System.err.println(ExceptionUtil.printStackTrace(e));
System.exit(-1);
}
}
}
All the Libs from Fop are in the Classpath including the fop.jar in build directory. After
I run thejavac Invokefop.java I get this error:
> C:\....\fop>javac Invokefop.java
Invokefop.java:21: cannot find symbol
symbol : class Driver
location: package org.apache.fop.apps
import org.apache.fop.apps.Driver;
^
Invokefop.java:23: package org.apache.fop.messaging does not exist
import org.apache.fop.messaging.MessageHandler;
^
Invokefop.java:31: cannot find symbol
symbol : class Driver
location: class Invokefop
Driver driver = new Driver();
^
Invokefop.java:31: cannot find symbol
symbol : class Driver
location: class Invokefop
Driver driver = new Driver();
^
Invokefop.java:36: cannot find symbol
symbol : variable MessageHandler
location: class Invokefop
MessageHandler.setScreenLogger(logger);
^
Invokefop.java:39: cannot find symbol
symbol : variable Driver
location: class Invokefop
driver.setRenderer(Driver.RENDER_PDF);
^
6 errors
I am relatively new to Java, but with this approach I try to execute the fop engine in c++ using this java class..
Have anybody some Idea, how to solve this errors...
Thanx in advance..
The classes that are coming up with "cannot find symbol" errors don't exist in the fop.jar file.
I just downloaded v0.95 of the FOP library, and I can't see those classes in any of the jar files in the distribution. (You can open a jar file in any zip program and have a look - a jar is basically a zip file with a few extra bits in there that Java uses).
I would guess that the classes referenced in your example code were removed at some stage from the FOP library, and the example is for the older version. So you could try and find an older version of the library that contains those classes, or look for newer examples. The binary distribution comes with some examples - maybe have a look through those to see if any are useful for you?
In my case I added the dependency in pom.xml
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>fop</artifactId>
<version>2.5</version>
</dependency>

Categories

Resources