shekhargulati / 52-technologies-in-2016

Let's learn a new technology every week. A new technology blog every Sunday in 2016.
https://shekhargulati.com/
MIT License
7.21k stars 595 forks source link

strman : static import issue #27

Closed Sudip7 closed 8 years ago

Sudip7 commented 8 years ago

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

shekhargulati commented 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

Sudip7 commented 8 years ago

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">

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>

`

shekhargulati commented 8 years ago

@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

Sudip7 commented 8 years ago

Now it's resolved. Thanks for quick assistance