Title
h

Holdge

05/30/2017, 4:31 PM
New to kotlin, wanna build kotlin from source and see how it works(eg: compiler or so), but I get problem when I try to build on my Mac OS, is there any tutorial in detail about build kotlin from source code?
👍 2
n

nicolay.mitropolsky

05/30/2017, 4:41 PM
kevinofneu: There is only a readme https://github.com/JetBrains/kotlin/blob/master/ReadMe.md#building but it should work most of time )
d

dalexander

05/30/2017, 5:31 PM
If you have more specific question than “I have a problem” we might be able to answer.
h

Holdge

05/31/2017, 2:37 AM
When I use
ant -f build.xml
, I got unresolved error,
[javac2] /Users/kevin/Workspace/github/kotlin/plugins/kapt3/src/org/jetbrains/kotlin/kapt3/util/javacListUtils.kt:42:60: error: unresolved reference: JavacList
   [javac2]     if (valuePairs == null || valuePairs.isEmpty()) return JavacList.nil()
   [javac2]                                                            ^
   [javac2] /Users/kevin/Workspace/github/kotlin/plugins/kapt3/src/org/jetbrains/kotlin/kapt3/util/javacListUtils.kt:45:18: error: unresolved reference: JavacList
   [javac2]     var result = JavacList.nil<T>()
   [javac2]                  ^
   [javac2] /Users/kevin/Workspace/github/kotlin/plugins/kapt3/src/org/jetbrains/kotlin/kapt3/util/javacListUtils.kt:57:33: error: unresolved reference: JavacList
   [javac2] internal operator fun <T : Any> JavacList<T>.plus(other: JavacList<T>): JavacList<T> {
   [javac2]                                 ^
   [javac2] /Users/kevin/Workspace/github/kotlin/plugins/kapt3/src/org/jetbrains/kotlin/kapt3/util/javacListUtils.kt:57:58: error: unresolved reference: JavacList
   [javac2] internal operator fun <T : Any> JavacList<T>.plus(other: JavacList<T>): JavacList<T> {
   [javac2]                                                          ^
   [javac2] /Users/kevin/Workspace/github/kotlin/plugins/kapt3/src/org/jetbrains/kotlin/kapt3/util/javacListUtils.kt:57:73: error: unresolved reference: JavacList
   [javac2] internal operator fun <T : Any> JavacList<T>.plus(other: JavacList<T>): JavacList<T> {
   [javac2]
n

nicolay.mitropolsky

05/31/2017, 4:46 AM
did
ant -f update_dependencies.xml
completed successfully ?
h

Holdge

05/31/2017, 5:23 AM
update_dependencies succeed
n

nicolay.mitropolsky

05/31/2017, 12:36 PM
Sometimes it could happen that dependency jars become broken during downloading. So maybe it worth to delete content of
ideaSDK
folder and try to update dependencies ons again.
h

Holdge

05/31/2017, 12:52 PM
OK,I will try later
thx
unfortunately,still with error, detail screenshot:

http://7xr586.com1.z0.glb.clouddn.com/images/qsf6v.jpg

d

dalexander

05/31/2017, 3:27 PM
Have you also run ant dist and do you have the three versions of Java installed? I would guess it might be dist related given that it’s failing to find something that should be within the project.
n

nicolay.mitropolsky

05/31/2017, 3:31 PM
Are there any warnings about
tools.jar
in the beginnig of build process? Are you sure that
JAVA_HOME
points to JDK not JRE?
h

Holdge

05/31/2017, 3:32 PM
In my .zshrc:
export JAVA_HOME="/Library/Java/Home"
export JDK_16="/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"
export JDK_18="/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home"
export JDK_17="/Library/Java/JavaVirtualMachines/jdk1.7.0_80.jdk/Contents/Home"
export PATH="$JAVA_HOME/bin:$JDK_16/bin:$JDK_17/bin:$JDK_18/bin:$PATH"
export ANT_OPTS="-Xmx1024m -XX:MaxPermSize=512m"
Is that ok?
There is no warnings about
tools.jar
in the beginnig of build process
n

nicolay.mitropolsky

05/31/2017, 3:34 PM
hm… try to point all of this Java Paths to
/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home
because all unresolved references I see in you sreenshot are parts of
tools.jar
of JDK
h

Holdge

05/31/2017, 3:49 PM
I shall have a try, thanks
@nicolay.mitropolsky @dalexander thank u guys, finally succeed!
May be I should post a blog about this procedure.
d

dalexander

06/02/2017, 11:30 AM
Glad it finally worked, do you know what made the difference? It might be valuable to have a walkthrough, the readme is a little bit dense sometimes
h

Holdge

06/02/2017, 1:34 PM
The Java environment on my computer is cracked, eventhough the environment variables are correctly setted, when it comes to build process, there are errors, may be I should checked it more carefaully. So it may be better if there are more detailed building process which can be used to check which parts are going wrong.