Libraries | SVG Export on IntelliJ IDEA

Hello processing community.

before I start, here is my environment:

IntelliJ IDEA 2019.1 (Community Edition)
Build #IC-191.6183.87, built on March 27, 2019
JRE: 1.8.0_202-release-1483-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Processing 3.5.3
Windows 10 10.0

What I intend to do is, save my sketch as svg or dxf.

What I did.
Step 1. In Processing I created this simple sketch, runs it, it works.

import processing.svg.*;

void setup() {
  size(400, 400, SVG, "E:\\xxx\\filename.svg");
}

void draw() {
  // Draw something good here
  line(0, 0, width/2, height);

  // Exit the program
  println("Finished.");
  exit();
}

Step 2. In IntelliJ IDEA, saw this

and
https://forum.processing.org/two/discussion/3687/cant-use-opengl-in-eclips
so, I have followed them by loading all of libs.
Here is the screen capture of it.
image

  1. When I try to run the code created in step 1 from IntelliJ IDEA. IntelliJ says, java.lang.RuntimeException: The processing.svg.PGraphicsSVG renderer is not in the class path.

  2. I can not put import processing.svg.*; in my sketch in IntelliJ, as it complains

Can not resolve symbol ‘svg’

How can I solve this problem?

Thank you for your help.

1 Like

Here is a screen cap of the issue.

1 Like

Hi! It looks ilke you didn’t add the svg libraries to the project. They are in the Processing folder. In my case in

/usr/share/processing/modes/java/libraries/svg/library

I see these files

batik-awt-util-1.8.jar  batik-dom-1.8.jar  batik-ext-1.8.jar  batik-svggen-1.8.jar  batik-util-1.8.jar  batik-xml-1.8.jar  LICENSE  svg.jar
2 Likes

Hi there.

It works.

Thank you so much for this.

For anyone from the future, you need to load the lib from

your processing location\modes\java\libraries\svg\library\