Non Maven Java project with Eclipse

Sanghyuk Jung edited this page Apr 5, 2016 · 14 revisions

Step 1 : Check your Java version

Make sure JRE version 1.6 or later is installed and used in Eclipse.

  1. Check your java version on the command line.

     java -version
    
  2. Check settings in Eclipse 'Project > Properties > Java compiler'

Step 2 : Download

Download multiline-string-0.1.2.jar and save it on your local machine.

Step 3 : Add the jar file to Classpath

  1. Go to 'Project > Properties > Java Build path > Libraries'
  2. add 'multiline-string-0.1.1.jar' file by 'add JARS..' or 'add External JARs..' button.

Step 4 : Check options for annotation processing in Eclipse.

  1. Go to 'Project > Properties > Java compiler > Annotation Processing '
  2. Select 'Enable project specific settings'
  3. Select 'Enable annotation processing'.

Step 5 : Add the jar file to 'Factory Path'

  1. Go to 'Project > Properties > Java compiler > Annotation Processing > Factroy Path'
  2. add 'multiline-string-0.1.2.jar' file by 'add JARS..' or 'add External JARs..' button. It will create '.factorypath' file on your project folder.

Step 6 : Test

Create a class for test and run it. The following example shows how to use the @Multiline annotation.

import org.adrianwalker.multilinestring.Multiline;

public class Hello {

    /**
     Hello!
     Multiline-string!!
    */
    @Multiline private static String msg;

    public static void main(String[] args) {
        System.out.println(msg);
    }
}

It will write the following message to the console.

Hello!
Multiline-string!!

Compile on the command line

Include 'multiline-string-0.1.2.jar' in the '-classpath' option.

javac -classpath multiline-string-0.1.2.jar Hello.java 
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.