Skip to content
Browse files

Site updated at 2012-02-20 03:57:34 UTC

  • Loading branch information...
1 parent b06c9d5 commit eddbd616a1f3f36c0ea15a4f95f9b8a32b101ce3 @trevorsummerssmith trevorsummerssmith committed
View
93 atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Ocheyedan Blog]]></title>
<link href="http://blog.ocheyedan.net/atom.xml" rel="self"/>
<link href="http://blog.ocheyedan.net/"/>
- <updated>2012-02-19T21:59:21-05:00</updated>
+ <updated>2012-02-19T22:57:29-05:00</updated>
<id>http://blog.ocheyedan.net/</id>
<author>
<name><![CDATA[Brian Langel and Trevor Smith]]></name>
@@ -14,6 +14,97 @@
<entry>
+ <title type="html"><![CDATA[Running Kotlin Code]]></title>
+ <link href="http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code/"/>
+ <updated>2012-02-19T22:35:00-05:00</updated>
+ <id>http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code</id>
+ <content type="html"><![CDATA[<p>The Kotlin tutorials do not discuss how to execute compiled Kotlin code from the command line.</p>
+
+<p>Setting up Kotlin, and running Kotlin code in the IntelliJ IDE plugin is documented
+<a href="http://hadihariri.com/2012/02/17/the-kotlin-journey-part-i-getting-things-set-up/">here</a>.</p>
+
+<p>Given that Kotlin is a young project, there are going to be bugs that are IDE specific.
+We wanted a way to compile and run Kotlin from the command line.</p>
+
+<p>One can compile Kotlin code using a variety of build tools documented
+<a href="http://confluence.jetbrains.net/display/Kotlin/Kotlin+Build+Tools">here</a>.</p>
+
+<p>There are two things one needs to do to run Kotlin code from the command line:</p>
+
+<ul>
+<li>The class path needs to include your compiled code as well as the Kotlin runtime jar</li>
+<li>The main class gets compiled into something called <em>namespace</em></li>
+</ul>
+
+
+<p>Below is an example using Ant. It assumes you have <a href="https://github.com/jetbrains/kotlin">built</a>
+the Kotlin runtime jar and the root Kotlin src directory is set to an environmental
+variable <em>KOTLIN_HOME</em>.</p>
+
+<p>Example Kotlin main:</p>
+
+<div><script src='https://gist.github.com/1867613.js?file='></script>
+<noscript><pre><code>fun main(args : Array&lt;String&gt;) {
+ println(&quot;hello, from Kotlin code!&quot;)
+}</code></pre></noscript></div>
+
+
+<p>Relevant Ant snippet:</p>
+
+<div><script src='https://gist.github.com/1867624.js?file='></script>
+<noscript><pre><code> &lt;path id=&quot;classpath.run&quot;&gt;
+ &lt;pathelement path=&quot;${output}/&quot;/&gt;
+ &lt;pathelement path=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar&quot;/&gt;
+ &lt;/path&gt;
+
+ &lt;target name=&quot;run&quot;&gt;
+ &lt;java classname=&quot;namespace&quot;&gt;
+ &lt;sysproperty key=&quot;file.encoding&quot; value=&quot;UTF-8&quot;/&gt;
+ &lt;classpath refid=&quot;classpath.run&quot;/&gt;
+ &lt;/java&gt;
+ &lt;/target&gt;</code></pre></noscript></div>
+
+
+<p>Complete Ant file:</p>
+
+<div><script src='https://gist.github.com/1867619.js?file='></script>
+<noscript><pre><code>&lt;project name=&quot;Kotlin&quot; default=&quot;compile&quot;&gt;
+
+ &lt;property environment=&quot;env&quot;/&gt;
+ &lt;taskdef file=&quot;${env.KOTLIN_HOME}/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/antlib.xml&quot;&gt;
+ &lt;classpath&gt;
+ &lt;fileset dir=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib&quot; includes=&quot;*.jar&quot;/&gt;
+ &lt;/classpath&gt;
+ &lt;/taskdef&gt;
+
+ &lt;property name=&quot;output&quot; value=&quot;${basedir}/dist&quot;/&gt;
+
+ &lt;target name=&quot;clean&quot;&gt;
+ &lt;delete dir=&quot;${output}&quot;/&gt;
+ &lt;/target&gt;
+
+ &lt;target name=&quot;compile&quot;&gt;
+ &lt;kotlinc src=&quot;${basedir}/src/main/kotlin/&quot; output=&quot;${output}&quot;/&gt;
+ &lt;/target&gt;
+
+ &lt;path id=&quot;classpath.run&quot;&gt;
+ &lt;pathelement path=&quot;${output}/&quot;/&gt;
+ &lt;pathelement path=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar&quot;/&gt;
+ &lt;/path&gt;
+
+ &lt;target name=&quot;run&quot;&gt;
+ &lt;java classname=&quot;namespace&quot;&gt;
+ &lt;sysproperty key=&quot;file.encoding&quot; value=&quot;UTF-8&quot;/&gt;
+ &lt;classpath refid=&quot;classpath.run&quot;/&gt;
+ &lt;/java&gt;
+ &lt;/target&gt;
+
+&lt;/project&gt;</code></pre></noscript></div>
+
+]]></content>
+ </entry>
+
+ <entry>
<title type="html"><![CDATA[Kotlin: A Nice Blend of Theory and Practice?]]></title>
<link href="http://blog.ocheyedan.net/blog/2012/02/19/kotlin-blend-theory-practice/"/>
<updated>2012-02-19T18:06:00-05:00</updated>
View
4 blog/2012/02/18/hello/index.html
@@ -155,6 +155,10 @@ <h1 class="entry-title">Hello.</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a>
</li>
View
6 blog/2012/02/19/kotlin-blend-theory-practice/index.html
@@ -176,6 +176,8 @@ <h1 class="entry-title">Kotlin: A Nice Blend of Theory and Practice?</h1>
<a class="basic-alignment left" href="/blog/2012/02/18/hello/" title="Previous Post: Hello.">&laquo; Hello.</a>
+ <a class="basic-alignment right" href="/blog/2012/02/19/running-kotlin-code/" title="next Post: Running Kotlin Code">Running Kotlin Code &raquo;</a>
+
</p>
</footer>
</article>
@@ -195,6 +197,10 @@ <h1 class="entry-title">Kotlin: A Nice Blend of Theory and Practice?</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a>
</li>
View
315 blog/2012/02/19/running-kotlin-code/index.html
@@ -0,0 +1,315 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Running Kotlin Code - Ocheyedan Blog</title>
+ <meta name="author" content="Brian Langel and Trevor Smith">
+
+
+ <meta name="description" content="The Kotlin tutorials do not discuss how to execute compiled Kotlin code from the command line. Setting up Kotlin, and running Kotlin code in the &hellip;">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="Ocheyedan Blog" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">Ocheyedan Blog</a></h1>
+
+ <h2>We are interested in making things hum</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:blog.ocheyedan.net" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article class="hentry" role="article">
+
+ <header>
+
+ <h1 class="entry-title">Running Kotlin Code</h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-02-19T22:35:00-05:00" pubdate data-updated="true">Feb 19<span>th</span>, 2012</time>
+
+ | <a href="#disqus_thread">Comments</a>
+
+ </p>
+
+ </header>
+
+
+<div class="entry-content"><p>The Kotlin tutorials do not discuss how to execute compiled Kotlin code from the command line.</p>
+
+<p>Setting up Kotlin, and running Kotlin code in the IntelliJ IDE plugin is documented
+<a href="http://hadihariri.com/2012/02/17/the-kotlin-journey-part-i-getting-things-set-up/">here</a>.</p>
+
+<p>Given that Kotlin is a young project, there are going to be bugs that are IDE specific.
+We wanted a way to compile and run Kotlin from the command line.</p>
+
+<p>One can compile Kotlin code using a variety of build tools documented
+<a href="http://confluence.jetbrains.net/display/Kotlin/Kotlin+Build+Tools">here</a>.</p>
+
+<p>There are two things one needs to do to run Kotlin code from the command line:</p>
+
+<ul>
+<li>The class path needs to include your compiled code as well as the Kotlin runtime jar</li>
+<li>The main class gets compiled into something called <em>namespace</em></li>
+</ul>
+
+
+<p>Below is an example using Ant. It assumes you have <a href="https://github.com/jetbrains/kotlin">built</a>
+the Kotlin runtime jar and the root Kotlin src directory is set to an environmental
+variable <em>KOTLIN_HOME</em>.</p>
+
+<p>Example Kotlin main:</p>
+
+<div><script src='https://gist.github.com/1867613.js?file='></script>
+<noscript><pre><code>fun main(args : Array&lt;String&gt;) {
+ println(&quot;hello, from Kotlin code!&quot;)
+}</code></pre></noscript></div>
+
+
+<p>Relevant Ant snippet:</p>
+
+<div><script src='https://gist.github.com/1867624.js?file='></script>
+<noscript><pre><code> &lt;path id=&quot;classpath.run&quot;&gt;
+ &lt;pathelement path=&quot;${output}/&quot;/&gt;
+ &lt;pathelement path=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar&quot;/&gt;
+ &lt;/path&gt;
+
+ &lt;target name=&quot;run&quot;&gt;
+ &lt;java classname=&quot;namespace&quot;&gt;
+ &lt;sysproperty key=&quot;file.encoding&quot; value=&quot;UTF-8&quot;/&gt;
+ &lt;classpath refid=&quot;classpath.run&quot;/&gt;
+ &lt;/java&gt;
+ &lt;/target&gt;</code></pre></noscript></div>
+
+
+<p>Complete Ant file:</p>
+
+<div><script src='https://gist.github.com/1867619.js?file='></script>
+<noscript><pre><code>&lt;project name=&quot;Kotlin&quot; default=&quot;compile&quot;&gt;
+
+ &lt;property environment=&quot;env&quot;/&gt;
+ &lt;taskdef file=&quot;${env.KOTLIN_HOME}/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/antlib.xml&quot;&gt;
+ &lt;classpath&gt;
+ &lt;fileset dir=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib&quot; includes=&quot;*.jar&quot;/&gt;
+ &lt;/classpath&gt;
+ &lt;/taskdef&gt;
+
+ &lt;property name=&quot;output&quot; value=&quot;${basedir}/dist&quot;/&gt;
+
+ &lt;target name=&quot;clean&quot;&gt;
+ &lt;delete dir=&quot;${output}&quot;/&gt;
+ &lt;/target&gt;
+
+ &lt;target name=&quot;compile&quot;&gt;
+ &lt;kotlinc src=&quot;${basedir}/src/main/kotlin/&quot; output=&quot;${output}&quot;/&gt;
+ &lt;/target&gt;
+
+ &lt;path id=&quot;classpath.run&quot;&gt;
+ &lt;pathelement path=&quot;${output}/&quot;/&gt;
+ &lt;pathelement path=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar&quot;/&gt;
+ &lt;/path&gt;
+
+ &lt;target name=&quot;run&quot;&gt;
+ &lt;java classname=&quot;namespace&quot;&gt;
+ &lt;sysproperty key=&quot;file.encoding&quot; value=&quot;UTF-8&quot;/&gt;
+ &lt;classpath refid=&quot;classpath.run&quot;/&gt;
+ &lt;/java&gt;
+ &lt;/target&gt;
+
+&lt;/project&gt;</code></pre></noscript></div>
+
+</div>
+
+
+ <footer>
+ <p class="meta">
+
+
+
+<span class="byline author vcard">Posted by <span class="fn">Brian Langel and Trevor Smith</span></span>
+
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-02-19T22:35:00-05:00" pubdate data-updated="true">Feb 19<span>th</span>, 2012</time>
+
+
+<span class="categories">
+
+ <a class='category' href='/blog/categories/kotlin/'>kotlin</a>, <a class='category' href='/blog/categories/tips/'>tips</a>
+
+</span>
+
+
+ </p>
+
+ <div class="sharing">
+
+ <a href="http://twitter.com/share" class="twitter-share-button" data-url="http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code/" data-via="" data-counturl="http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code/" >Tweet</a>
+
+
+
+</div>
+
+
+ <p class="meta">
+
+ <a class="basic-alignment left" href="/blog/2012/02/19/kotlin-blend-theory-practice/" title="Previous Post: Kotlin: A Nice Blend of Theory and Practice?">&laquo; Kotlin: A Nice Blend of Theory and Practice?</a>
+
+
+ </p>
+ </footer>
+</article>
+
+ <section>
+ <h1>Comments</h1>
+ <div id="disqus_thread" aria-live="polite"><noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+</div>
+ </section>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2012/02/18/hello/">Hello.</a>
+ </li>
+
+ </ul>
+</section>
+
+
+
+
+
+
+
+</aside>
+
+
+ </div>
+ </div>
+ <footer role="contentinfo"><p>
+ Copyright &copy; 2012 - Brian Langel and Trevor Smith -
+ <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
+</p>
+
+</footer>
+
+
+<script type="text/javascript">
+ var disqus_shortname = 'ocheyedan';
+
+
+ // var disqus_developer = 1;
+ var disqus_identifier = 'http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code/';
+ var disqus_url = 'http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code/';
+ var disqus_script = 'embed.js';
+
+ (function () {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ }());
+</script>
+
+
+
+
+
+
+
+ <script type="text/javascript">
+ (function(){
+ var twitterWidgets = document.createElement('script');
+ twitterWidgets.type = 'text/javascript';
+ twitterWidgets.async = true;
+ twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
+ document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
+ })();
+ </script>
+
+
+
+
+
+</body>
+</html>
View
24 blog/archives/index.html
@@ -9,9 +9,9 @@
<meta name="author" content="Brian Langel and Trevor Smith">
- <meta name="description" content="Blog Archive 2012 Kotlin: A Nice Blend of Theory and Practice?
-Feb 19 2012 posted in java, kotlin, programming_languages Hello.
-Feb 18 2012 Recent &hellip;">
+ <meta name="description" content="Blog Archive 2012 Running Kotlin Code
+Feb 19 2012 posted in kotlin, tips Kotlin: A Nice Blend of Theory and Practice?
+Feb 19 2012 posted in java, &hellip;">
<!-- http://t.co/dKP3o1e -->
@@ -81,6 +81,20 @@ <h1 class="entry-title">Blog Archive</h1>
<article>
+<h1><a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a></h1>
+<time datetime="2012-02-19T22:35:00-05:00" pubdate><span class='month'>Feb</span> <span class='day'>19</span> <span class='year'>2012</span></time>
+
+<footer>
+ <span class="categories">posted in <a class='category' href='/blog/categories/kotlin/'>kotlin</a>, <a class='category' href='/blog/categories/tips/'>tips</a></span>
+</footer>
+
+
+</article>
+
+
+
+<article>
+
<h1><a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a></h1>
<time datetime="2012-02-19T18:06:00-05:00" pubdate><span class='month'>Feb</span> <span class='day'>19</span> <span class='year'>2012</span></time>
@@ -115,6 +129,10 @@ <h1 class="entry-title">Blog Archive</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a>
</li>
View
2 blog/categories/java/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: java | Ocheyedan Blog]]></title>
<link href="http://blog.ocheyedan.net/blog/categories/java/atom.xml" rel="self"/>
<link href="http://blog.ocheyedan.net/"/>
- <updated>2012-02-19T21:59:21-05:00</updated>
+ <updated>2012-02-19T22:57:29-05:00</updated>
<id>http://blog.ocheyedan.net/</id>
<author>
<name><![CDATA[Brian Langel and Trevor Smith]]></name>
View
4 blog/categories/java/index.html
@@ -103,6 +103,10 @@ <h1 class="entry-title">Category: Java</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a>
</li>
View
90 blog/categories/kotlin/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: kotlin | Ocheyedan Blog]]></title>
<link href="http://blog.ocheyedan.net/blog/categories/kotlin/atom.xml" rel="self"/>
<link href="http://blog.ocheyedan.net/"/>
- <updated>2012-02-19T21:59:21-05:00</updated>
+ <updated>2012-02-19T22:57:29-05:00</updated>
<id>http://blog.ocheyedan.net/</id>
<author>
<name><![CDATA[Brian Langel and Trevor Smith]]></name>
@@ -14,6 +14,94 @@
<entry>
+ <title type="html"><![CDATA[Running Kotlin Code]]></title>
+ <link href="http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code/"/>
+ <updated>2012-02-19T22:35:00-05:00</updated>
+ <id>http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code</id>
+ <content type="html"><![CDATA[<p>The Kotlin tutorials do not discuss how to execute compiled Kotlin code from the command line.</p>
+
+<p>Setting up Kotlin, and running Kotlin code in the IntelliJ IDE plugin is documented
+<a href="http://hadihariri.com/2012/02/17/the-kotlin-journey-part-i-getting-things-set-up/">here</a>.</p>
+
+<p>Given that Kotlin is a young project, there are going to be bugs that are IDE specific.
+We wanted a way to compile and run Kotlin from the command line.</p>
+
+<p>One can compile Kotlin code using a variety of build tools documented
+<a href="http://confluence.jetbrains.net/display/Kotlin/Kotlin+Build+Tools">here</a>.</p>
+
+<p>There are two things one needs to do to run Kotlin code from the command line:</p>
+
+<ul>
+<li>The class path needs to include your compiled code as well as the Kotlin runtime jar</li>
+<li>The main class gets compiled into something called <em>namespace</em></li>
+</ul>
+
+
+<p>Below is an example using Ant. It assumes you have <a href="https://github.com/jetbrains/kotlin">built</a>
+the Kotlin runtime jar and the root Kotlin src directory is set to an environmental
+variable <em>KOTLIN_HOME</em>.</p>
+
+<p>Example Kotlin main:
+<div><script src='https://gist.github.com/1867613.js?file='></script>
+<noscript><pre><code>fun main(args : Array&lt;String&gt;) {
+ println(&quot;hello, from Kotlin code!&quot;)
+}</code></pre></noscript></div>
+</p>
+
+<p>Relevant Ant snippet:
+<div><script src='https://gist.github.com/1867624.js?file='></script>
+<noscript><pre><code> &lt;path id=&quot;classpath.run&quot;&gt;
+ &lt;pathelement path=&quot;${output}/&quot;/&gt;
+ &lt;pathelement path=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar&quot;/&gt;
+ &lt;/path&gt;
+
+ &lt;target name=&quot;run&quot;&gt;
+ &lt;java classname=&quot;namespace&quot;&gt;
+ &lt;sysproperty key=&quot;file.encoding&quot; value=&quot;UTF-8&quot;/&gt;
+ &lt;classpath refid=&quot;classpath.run&quot;/&gt;
+ &lt;/java&gt;
+ &lt;/target&gt;</code></pre></noscript></div>
+</p>
+
+<p>Complete Ant file:
+<div><script src='https://gist.github.com/1867619.js?file='></script>
+<noscript><pre><code>&lt;project name=&quot;Kotlin&quot; default=&quot;compile&quot;&gt;
+
+ &lt;property environment=&quot;env&quot;/&gt;
+ &lt;taskdef file=&quot;${env.KOTLIN_HOME}/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/antlib.xml&quot;&gt;
+ &lt;classpath&gt;
+ &lt;fileset dir=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib&quot; includes=&quot;*.jar&quot;/&gt;
+ &lt;/classpath&gt;
+ &lt;/taskdef&gt;
+
+ &lt;property name=&quot;output&quot; value=&quot;${basedir}/dist&quot;/&gt;
+
+ &lt;target name=&quot;clean&quot;&gt;
+ &lt;delete dir=&quot;${output}&quot;/&gt;
+ &lt;/target&gt;
+
+ &lt;target name=&quot;compile&quot;&gt;
+ &lt;kotlinc src=&quot;${basedir}/src/main/kotlin/&quot; output=&quot;${output}&quot;/&gt;
+ &lt;/target&gt;
+
+ &lt;path id=&quot;classpath.run&quot;&gt;
+ &lt;pathelement path=&quot;${output}/&quot;/&gt;
+ &lt;pathelement path=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar&quot;/&gt;
+ &lt;/path&gt;
+
+ &lt;target name=&quot;run&quot;&gt;
+ &lt;java classname=&quot;namespace&quot;&gt;
+ &lt;sysproperty key=&quot;file.encoding&quot; value=&quot;UTF-8&quot;/&gt;
+ &lt;classpath refid=&quot;classpath.run&quot;/&gt;
+ &lt;/java&gt;
+ &lt;/target&gt;
+
+&lt;/project&gt;</code></pre></noscript></div>
+</p>
+]]></content>
+ </entry>
+
+ <entry>
<title type="html"><![CDATA[Kotlin: A Nice Blend of Theory and Practice?]]></title>
<link href="http://blog.ocheyedan.net/blog/2012/02/19/kotlin-blend-theory-practice/"/>
<updated>2012-02-19T18:06:00-05:00</updated>
View
18 blog/categories/kotlin/index.html
@@ -79,6 +79,20 @@ <h1 class="entry-title">Category: Kotlin</h1>
<article>
+<h1><a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a></h1>
+<time datetime="2012-02-19T22:35:00-05:00" pubdate><span class='month'>Feb</span> <span class='day'>19</span> <span class='year'>2012</span></time>
+
+<footer>
+ <span class="categories">posted in <a class='category' href='/blog/categories/kotlin/'>kotlin</a>, <a class='category' href='/blog/categories/tips/'>tips</a></span>
+</footer>
+
+
+</article>
+
+
+
+<article>
+
<h1><a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a></h1>
<time datetime="2012-02-19T18:06:00-05:00" pubdate><span class='month'>Feb</span> <span class='day'>19</span> <span class='year'>2012</span></time>
@@ -103,6 +117,10 @@ <h1 class="entry-title">Category: Kotlin</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a>
</li>
View
2 blog/categories/programming-languages/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: programming_languages | Ocheyedan Blog]]></title>
<link href="http://blog.ocheyedan.net/blog/categories/programming-languages/atom.xml" rel="self"/>
<link href="http://blog.ocheyedan.net/"/>
- <updated>2012-02-19T21:59:21-05:00</updated>
+ <updated>2012-02-19T22:57:29-05:00</updated>
<id>http://blog.ocheyedan.net/</id>
<author>
<name><![CDATA[Brian Langel and Trevor Smith]]></name>
View
4 blog/categories/programming-languages/index.html
@@ -103,6 +103,10 @@ <h1 class="entry-title">Category: Programming_languages</h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a>
</li>
View
104 blog/categories/tips/atom.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+
+ <title><![CDATA[Category: tips | Ocheyedan Blog]]></title>
+ <link href="http://blog.ocheyedan.net/blog/categories/tips/atom.xml" rel="self"/>
+ <link href="http://blog.ocheyedan.net/"/>
+ <updated>2012-02-19T22:57:29-05:00</updated>
+ <id>http://blog.ocheyedan.net/</id>
+ <author>
+ <name><![CDATA[Brian Langel and Trevor Smith]]></name>
+
+ </author>
+ <generator uri="http://octopress.org/">Octopress</generator>
+
+
+ <entry>
+ <title type="html"><![CDATA[Running Kotlin Code]]></title>
+ <link href="http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code/"/>
+ <updated>2012-02-19T22:35:00-05:00</updated>
+ <id>http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code</id>
+ <content type="html"><![CDATA[<p>The Kotlin tutorials do not discuss how to execute compiled Kotlin code from the command line.</p>
+
+<p>Setting up Kotlin, and running Kotlin code in the IntelliJ IDE plugin is documented
+<a href="http://hadihariri.com/2012/02/17/the-kotlin-journey-part-i-getting-things-set-up/">here</a>.</p>
+
+<p>Given that Kotlin is a young project, there are going to be bugs that are IDE specific.
+We wanted a way to compile and run Kotlin from the command line.</p>
+
+<p>One can compile Kotlin code using a variety of build tools documented
+<a href="http://confluence.jetbrains.net/display/Kotlin/Kotlin+Build+Tools">here</a>.</p>
+
+<p>There are two things one needs to do to run Kotlin code from the command line:</p>
+
+<ul>
+<li>The class path needs to include your compiled code as well as the Kotlin runtime jar</li>
+<li>The main class gets compiled into something called <em>namespace</em></li>
+</ul>
+
+
+<p>Below is an example using Ant. It assumes you have <a href="https://github.com/jetbrains/kotlin">built</a>
+the Kotlin runtime jar and the root Kotlin src directory is set to an environmental
+variable <em>KOTLIN_HOME</em>.</p>
+
+<p>Example Kotlin main:
+<div><script src='https://gist.github.com/1867613.js?file='></script>
+<noscript><pre><code>fun main(args : Array&lt;String&gt;) {
+ println(&quot;hello, from Kotlin code!&quot;)
+}</code></pre></noscript></div>
+</p>
+
+<p>Relevant Ant snippet:
+<div><script src='https://gist.github.com/1867624.js?file='></script>
+<noscript><pre><code> &lt;path id=&quot;classpath.run&quot;&gt;
+ &lt;pathelement path=&quot;${output}/&quot;/&gt;
+ &lt;pathelement path=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar&quot;/&gt;
+ &lt;/path&gt;
+
+ &lt;target name=&quot;run&quot;&gt;
+ &lt;java classname=&quot;namespace&quot;&gt;
+ &lt;sysproperty key=&quot;file.encoding&quot; value=&quot;UTF-8&quot;/&gt;
+ &lt;classpath refid=&quot;classpath.run&quot;/&gt;
+ &lt;/java&gt;
+ &lt;/target&gt;</code></pre></noscript></div>
+</p>
+
+<p>Complete Ant file:
+<div><script src='https://gist.github.com/1867619.js?file='></script>
+<noscript><pre><code>&lt;project name=&quot;Kotlin&quot; default=&quot;compile&quot;&gt;
+
+ &lt;property environment=&quot;env&quot;/&gt;
+ &lt;taskdef file=&quot;${env.KOTLIN_HOME}/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/antlib.xml&quot;&gt;
+ &lt;classpath&gt;
+ &lt;fileset dir=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib&quot; includes=&quot;*.jar&quot;/&gt;
+ &lt;/classpath&gt;
+ &lt;/taskdef&gt;
+
+ &lt;property name=&quot;output&quot; value=&quot;${basedir}/dist&quot;/&gt;
+
+ &lt;target name=&quot;clean&quot;&gt;
+ &lt;delete dir=&quot;${output}&quot;/&gt;
+ &lt;/target&gt;
+
+ &lt;target name=&quot;compile&quot;&gt;
+ &lt;kotlinc src=&quot;${basedir}/src/main/kotlin/&quot; output=&quot;${output}&quot;/&gt;
+ &lt;/target&gt;
+
+ &lt;path id=&quot;classpath.run&quot;&gt;
+ &lt;pathelement path=&quot;${output}/&quot;/&gt;
+ &lt;pathelement path=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar&quot;/&gt;
+ &lt;/path&gt;
+
+ &lt;target name=&quot;run&quot;&gt;
+ &lt;java classname=&quot;namespace&quot;&gt;
+ &lt;sysproperty key=&quot;file.encoding&quot; value=&quot;UTF-8&quot;/&gt;
+ &lt;classpath refid=&quot;classpath.run&quot;/&gt;
+ &lt;/java&gt;
+ &lt;/target&gt;
+
+&lt;/project&gt;</code></pre></noscript></div>
+</p>
+]]></content>
+ </entry>
+
+</feed>
View
173 blog/categories/tips/index.html
@@ -0,0 +1,173 @@
+
+<!DOCTYPE html>
+<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
+<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
+<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
+<head>
+ <meta charset="utf-8">
+ <title>Category: tips - Ocheyedan Blog</title>
+ <meta name="author" content="Brian Langel and Trevor Smith">
+
+
+ <meta name="description" content="Category: tips">
+
+
+ <!-- http://t.co/dKP3o1e -->
+ <meta name="HandheldFriendly" content="True">
+ <meta name="MobileOptimized" content="320">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+
+
+ <link rel="canonical" href="http://blog.ocheyedan.netblog/categories/tips">
+ <link href="/favicon.png" rel="icon">
+ <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
+ <script src="/javascripts/modernizr-2.0.js"></script>
+ <script src="/javascripts/ender.js"></script>
+ <script src="/javascripts/octopress.js" type="text/javascript"></script>
+ <link href="/atom.xml" rel="alternate" title="Ocheyedan Blog" type="application/atom+xml">
+ <!--Fonts from Google"s Web font directory at http://google.com/webfonts -->
+<link href="http://fonts.googleapis.com/css?family=PT+Serif:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+<link href="http://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
+
+
+
+</head>
+
+<body >
+ <header role="banner"><hgroup>
+ <h1><a href="/">Ocheyedan Blog</a></h1>
+
+ <h2>We are interested in making things hum</h2>
+
+</hgroup>
+
+</header>
+ <nav role="navigation"><ul class="subscription" data-subscription="rss">
+ <li><a href="/atom.xml" rel="subscribe-rss" title="subscribe via RSS">RSS</a></li>
+
+</ul>
+
+<form action="http://google.com/search" method="get">
+ <fieldset role="search">
+ <input type="hidden" name="q" value="site:blog.ocheyedan.net" />
+ <input class="search" type="text" name="q" results="0" placeholder="Search"/>
+ </fieldset>
+</form>
+
+<ul class="main-navigation">
+ <li><a href="/">Blog</a></li>
+ <li><a href="/blog/archives">Archives</a></li>
+</ul>
+
+</nav>
+ <div id="main">
+ <div id="content">
+ <div>
+<article role="article">
+
+ <header>
+ <h1 class="entry-title">Category: Tips</h1>
+
+ </header>
+
+ <div id="blog-archives" class="category">
+
+
+
+
+ <h2>2012</h2>
+
+<article>
+
+<h1><a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a></h1>
+<time datetime="2012-02-19T22:35:00-05:00" pubdate><span class='month'>Feb</span> <span class='day'>19</span> <span class='year'>2012</span></time>
+
+<footer>
+ <span class="categories">posted in <a class='category' href='/blog/categories/kotlin/'>kotlin</a>, <a class='category' href='/blog/categories/tips/'>tips</a></span>
+</footer>
+
+
+</article>
+
+</div>
+
+
+</article>
+
+</div>
+
+<aside class="sidebar">
+
+ <section>
+ <h1>Recent Posts</h1>
+ <ul id="recent_posts">
+
+ <li class="post">
+ <a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a>
+ </li>
+
+ <li class="post">
+ <a href="/blog/2012/02/18/hello/">Hello.</a>
+ </li>
+
+ </ul>
+</section>
+
+
+
+
+
+
+
+</aside>
+
+
+ </div>
+ </div>
+ <footer role="contentinfo"><p>
+ Copyright &copy; 2012 - Brian Langel and Trevor Smith -
+ <span class="credit">Powered by <a href="http://octopress.org">Octopress</a></span>
+</p>
+
+</footer>
+
+
+<script type="text/javascript">
+ var disqus_shortname = 'ocheyedan';
+
+
+ var disqus_script = 'count.js';
+
+ (function () {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ }());
+</script>
+
+
+
+
+
+
+
+ <script type="text/javascript">
+ (function(){
+ var twitterWidgets = document.createElement('script');
+ twitterWidgets.type = 'text/javascript';
+ twitterWidgets.async = true;
+ twitterWidgets.src = 'http://platform.twitter.com/widgets.js';
+ document.getElementsByTagName('head')[0].appendChild(twitterWidgets);
+ })();
+ </script>
+
+
+
+
+
+</body>
+</html>
View
127 index.html
@@ -9,8 +9,7 @@
<meta name="author" content="Brian Langel and Trevor Smith">
- <meta name="description" content="Why We&#8217;re Interested in a New Language In college we were introduced to SML and OCaml. We became enamored with
-functional programming and &hellip;">
+ <meta name="description" content="The Kotlin tutorials do not discuss how to execute compiled Kotlin code from the command line. Setting up Kotlin, and running Kotlin code in the &hellip;">
<!-- http://t.co/dKP3o1e -->
@@ -71,6 +70,126 @@
<header>
+ <h1 class="entry-title"><a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a></h1>
+
+
+ <p class="meta">
+
+
+
+
+
+
+
+
+
+
+
+
+<time datetime="2012-02-19T22:35:00-05:00" pubdate data-updated="true">Feb 19<span>th</span>, 2012</time>
+
+ | <a href="/blog/2012/02/19/running-kotlin-code/#disqus_thread">Comments</a>
+
+ </p>
+
+ </header>
+
+
+ <div class="entry-content"><p>The Kotlin tutorials do not discuss how to execute compiled Kotlin code from the command line.</p>
+
+<p>Setting up Kotlin, and running Kotlin code in the IntelliJ IDE plugin is documented
+<a href="http://hadihariri.com/2012/02/17/the-kotlin-journey-part-i-getting-things-set-up/">here</a>.</p>
+
+<p>Given that Kotlin is a young project, there are going to be bugs that are IDE specific.
+We wanted a way to compile and run Kotlin from the command line.</p>
+
+<p>One can compile Kotlin code using a variety of build tools documented
+<a href="http://confluence.jetbrains.net/display/Kotlin/Kotlin+Build+Tools">here</a>.</p>
+
+<p>There are two things one needs to do to run Kotlin code from the command line:</p>
+
+<ul>
+<li>The class path needs to include your compiled code as well as the Kotlin runtime jar</li>
+<li>The main class gets compiled into something called <em>namespace</em></li>
+</ul>
+
+
+<p>Below is an example using Ant. It assumes you have <a href="https://github.com/jetbrains/kotlin">built</a>
+the Kotlin runtime jar and the root Kotlin src directory is set to an environmental
+variable <em>KOTLIN_HOME</em>.</p>
+
+<p>Example Kotlin main:</p>
+
+<div><script src='https://gist.github.com/1867613.js?file='></script>
+<noscript><pre><code>fun main(args : Array&lt;String&gt;) {
+ println(&quot;hello, from Kotlin code!&quot;)
+}</code></pre></noscript></div>
+
+
+<p>Relevant Ant snippet:</p>
+
+<div><script src='https://gist.github.com/1867624.js?file='></script>
+<noscript><pre><code> &lt;path id=&quot;classpath.run&quot;&gt;
+ &lt;pathelement path=&quot;${output}/&quot;/&gt;
+ &lt;pathelement path=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar&quot;/&gt;
+ &lt;/path&gt;
+
+ &lt;target name=&quot;run&quot;&gt;
+ &lt;java classname=&quot;namespace&quot;&gt;
+ &lt;sysproperty key=&quot;file.encoding&quot; value=&quot;UTF-8&quot;/&gt;
+ &lt;classpath refid=&quot;classpath.run&quot;/&gt;
+ &lt;/java&gt;
+ &lt;/target&gt;</code></pre></noscript></div>
+
+
+<p>Complete Ant file:</p>
+
+<div><script src='https://gist.github.com/1867619.js?file='></script>
+<noscript><pre><code>&lt;project name=&quot;Kotlin&quot; default=&quot;compile&quot;&gt;
+
+ &lt;property environment=&quot;env&quot;/&gt;
+ &lt;taskdef file=&quot;${env.KOTLIN_HOME}/build-tools/ant/src/org/jetbrains/jet/buildtools/ant/antlib.xml&quot;&gt;
+ &lt;classpath&gt;
+ &lt;fileset dir=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib&quot; includes=&quot;*.jar&quot;/&gt;
+ &lt;/classpath&gt;
+ &lt;/taskdef&gt;
+
+ &lt;property name=&quot;output&quot; value=&quot;${basedir}/dist&quot;/&gt;
+
+ &lt;target name=&quot;clean&quot;&gt;
+ &lt;delete dir=&quot;${output}&quot;/&gt;
+ &lt;/target&gt;
+
+ &lt;target name=&quot;compile&quot;&gt;
+ &lt;kotlinc src=&quot;${basedir}/src/main/kotlin/&quot; output=&quot;${output}&quot;/&gt;
+ &lt;/target&gt;
+
+ &lt;path id=&quot;classpath.run&quot;&gt;
+ &lt;pathelement path=&quot;${output}/&quot;/&gt;
+ &lt;pathelement path=&quot;${env.KOTLIN_HOME}/dist/kotlinc/lib/kotlin-runtime.jar&quot;/&gt;
+ &lt;/path&gt;
+
+ &lt;target name=&quot;run&quot;&gt;
+ &lt;java classname=&quot;namespace&quot;&gt;
+ &lt;sysproperty key=&quot;file.encoding&quot; value=&quot;UTF-8&quot;/&gt;
+ &lt;classpath refid=&quot;classpath.run&quot;/&gt;
+ &lt;/java&gt;
+ &lt;/target&gt;
+
+&lt;/project&gt;</code></pre></noscript></div>
+
+</div>
+
+
+
+
+ </article>
+
+
+ <article>
+
+ <header>
+
<h1 class="entry-title"><a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a></h1>
@@ -189,6 +308,10 @@ <h1 class="entry-title"><a href="/blog/2012/02/18/hello/">Hello.</a></h1>
<ul id="recent_posts">
<li class="post">
+ <a href="/blog/2012/02/19/running-kotlin-code/">Running Kotlin Code</a>
+ </li>
+
+ <li class="post">
<a href="/blog/2012/02/19/kotlin-blend-theory-practice/">Kotlin: A Nice Blend of Theory and Practice?</a>
</li>
View
8 sitemap.xml
@@ -9,11 +9,15 @@
<lastmod>2012-02-19T21:03:01-05:00</lastmod>
</url>
<url>
+ <loc>http://blog.ocheyedan.net/blog/2012/02/19/running-kotlin-code/</loc>
+ <lastmod>2012-02-19T22:56:05-05:00</lastmod>
+ </url>
+ <url>
<loc>http://blog.ocheyedan.net/blog/archives/</loc>
- <lastmod>2012-02-19T21:03:01-05:00</lastmod>
+ <lastmod>2012-02-19T22:56:05-05:00</lastmod>
</url>
<url>
<loc>http://blog.ocheyedan.net/</loc>
- <lastmod>2012-02-19T21:03:01-05:00</lastmod>
+ <lastmod>2012-02-19T22:56:05-05:00</lastmod>
</url>
</urlset>

0 comments on commit eddbd61

Please sign in to comment.
Something went wrong with that request. Please try again.