I am a beginner at using Apache Camel. I have a maven project with the following structure:
File Write_Paper contains the content below:
When I compile this file by using cmd with: javac Write_Paper.java
, I get some errors:
Write_Paper.java:3: error: package org.apache.camel does not exist
import org.apache.camel.CamelContext;
Write_Paper.java:4: error: package org.apache.camel.builder does not exist
import org.apache.camel.builder.RouteBuilder;
Write_Paper.java:5: error: package org.apache.camel.impl does not exist
import org.apache.camel.impl.DefaultCamelContext;
Write_Paper.java:9: error: cannot find symbol
CamelContext context = new DefaultCamelContext()
symbol: class CamelContext
location: class Write_Paper
Write_Paper.java:9: error: cannot find symbol
symbol: class DefaultCamelContext
location: class Write_Paper
Write_Paper.java:10: error: cannot find symbol
context.addRoutes(new RouteBuilder() {
symbol: class RouteBuilder
location: class Write_Paper
Write_Paper.java:12: error: cannot find symbol
from("file:sourceFolder?noop=true")
symbol: method from(String)
7 errors
pom.xml
file content here
I have tried many solutions but I cannot fix them. what should I do to fix it?
Pom.xml
Standalone java code
keep the file inside the src/main/resources folder:
file name = log4j.properties inside file content:
It should work.