2

My experience with Java: Read-Only

I have these lines in my code:

import com.altova.io.*;
import com.mapforce.*;

The packages are in Mapping.jar, which is on my classpath, indeed it is first. Javac -verbose admits this:

[search path for source files: Mapping.jar,.,[etc]

When the compiler gets to the use lines, however:

[loading com/altova/io/Input.class(com/altova/io:Input.class)]
ShapeTypeFiddle.java:339: cannot find symbol
symbol  : class io
location: package com.altova
            com.altova.io.StringInput(sthing.toString());
                      ^

(+ two others, one is the MappingMapToinput2Output.run(input, output), the other is the output.getContent() call.)

Unzipping the Mapping.jar file does show compiled .class files for the Input.class, the MappingMapToinput2Output.class and the Output.class class files.

What else can I check?

0

1 Answer 1

2

It's looking for the class io which should have the static method StringInput. But you actually want to create an instance of StringInput. That can only mean that you forgot the new operator.

new com.altova.io.StringInput(sthing.toString());
Sign up to request clarification or add additional context in comments.

3 Comments

Ahhh, ok, I get it now. It's trying to call StringInput(String) as a static method of io. Good catch.
There were three errors, and they were each different (but, "helpfully", Java reports the same error text...) 1. The first one is as described by BalusC: lack of a "new" keyword, so there was no instance of the object. 2. The second one, there was a new -- but it was out of scope. 3. The third one, ... never trust the damned documentation and read the code. The documents claimed there was a getContent() method.
I gather that the problem as asked in the question is solved? If you still stucks with a new problem, you can just ask a new question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.