havardh / javaflow

Java model to flowtype converter
22 stars 5 forks source link

Could not find or load main class com.github.havardh.javaflow.JavaFlow #73

Closed jpomykala closed 5 years ago

jpomykala commented 5 years ago
jpomykala@Jakub-MBP:assortment/shortages ‹dev*›$ javaflow RefillFilterParams.java > param.js
Error: Could not find or load main class com.github.havardh.javaflow.JavaFlow
Caused by: java.lang.ClassNotFoundException: com.github.havardh.javaflow.JavaFlow

Build command: gradle assemble Version: 1.4.2 (same on 1.5.2-SNAPSHOT)

import java.time.LocalDate;

@AllArgsConstructor
@NoArgsConstructor
@Data
public class RefillFilterParams {
  private LocalDate startDate;
  private LocalDate endDate;
}
havardh commented 5 years ago

Hey @jpomykala, thank you for taking the time to file an issue. I'm happy to see that you are trying to make use of javaflow, please let me know if you need any changes to be able to use it for your project.

Could you try installing javaflow using the released zip or tar as described here? I see that I had forgot to include it for the last few versions, but the newest version 1.5.0 is available now :)

If you are still seeing this error then I'm curios to hear what steps you took. When you run gradle assemble you will get the archives mentioned above in the build/distributions folder. One of them must be unpacked, then you can run javaflow or javaflow.bat under the bin directory. If you tried to use build/scripts/javaflow it will not work, as this is just an intermediate build artifact.

Ps. You can use javaflow-maven-plugin for integrating javaflow into a maven build.

jpomykala commented 5 years ago

Still the same error on 1.5.0. :( I didn't test maven version.

pascalgn commented 5 years ago

I cannot reproduce the issue. I downloaded the release from here (javaflow-1.5.0.zip)

$ cd Downloads/
$ unzip javaflow-1.5.0.zip
$ cd javaflow-1.5.0/bin/
$ ./javaflow
/* @flow */
/* eslint-disable no-use-before-define */
/* Generated by javaflow 1.5.0 */

$ java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
havardh commented 5 years ago

@jpomykala: Could add details about:

1) Did you install using the zip or tar? 2) What is your java version? 3) What is your OS and version? 4) Did you install javaflow on your path? If so, how? 5) Is the result the same if you reproduce @pascalgn commands from the comment above?

havardh commented 5 years ago

@jpomykala: As we've not been able to reproduce and not heard back from you I will close this issue now. Please feel free to call for it to be reopened if you provide more details :)