strman : static import issue
Sudip7 opened this issue · comments
Hi Shekhar,
The other day I was playing with your code for strman: java library but I got some error.
My sole class comprised of main() and static import statement on top. Could you please assist on what went wrong. Is it coz of java version issue, m using java 8.
error: static import only from classes and interfaces
Regards
Sudip Nayak
@Sudip7 can you share code via gist or pastebin? There is stackoverflow issue that mentions the issue https://stackoverflow.com/questions/11782076/static-import-only-from-classes-and-interfaces
Please find the source code below:
`import static strman.append;
public class strmanJava {
public static void main(String args[]){
System.out.println("testing new java library");
}
}`
Pom.xml
`
4.0.0
<groupId>com.javalib</groupId>
<artifactId>Java8JsonLib</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>com.shekhargulati</groupId>
<artifactId>strman</artifactId>
<version>0.1.0</version>
<type>jar</type>
</dependency>
</dependencies>
`
@Sudip7 sorry its my bad. README.md was incorrect. You have to import import static strman.Strman.append
as all functions are inside Strman class. Also, if you face any issue can you raise issues in the library Github project https://github.com/shekhargulati/strman-java
Now it's resolved. Thanks for quick assistance