Closed Sudip7 closed 8 years ago
@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 `<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<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
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