How to build jnativehook on window 10 - jnativehook

I am using jnativehook on my program. I edit source code little and It works well on mac.
But When it is executed on window, I got this error.
8월 18, 2017 10:47:48 오전 org.jnativehook.DefaultLibraryLocator getLibraries
심각: Unable to extract the nativelibrary /org/jnativehook/lib/windows/x86_64/JNativeHook.dll!
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:389)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: org.jnativehook.GlobalScreen.getAutoRepeatRate()Ljava/lang/Integer;
at org.jnativehook.GlobalScreen.getAutoRepeatRate(Native Method)
at org.jnativehook.GlobalScreen.<clinit>(Unknown Source)
at SmiPlayer.Main.main(Main.java:75)
... 11 more
Exception running application SmiPlayer.Main
So I tried to build it on Window. I setted JAVA_HOME path and added JNITasks.
But I got this message.
BUILD FAILED
C:\jnativehook-2.1.0\build.xml:345: Execute failed: java.io.IOException: Cannot run program "sh" (in directory "C:\jnativehook-2.1.0\src\libuiohook"): CreateProcess error=2
I tried cross.build.xml too but I god this error.
BUILD FAILED
C:\jnativehook-2.1.0\cross.build.xml:160: The following error occurred while executing this line:
C:\jnativehook-2.1.0\jnitasks\build.xml:76: Compile failed; see the compiler error output for details.
line 160 is 5th line of below code block
Compiling JNITasks source...
<ant antfile="${basedir}/jnitasks/build.xml" dir="${basedir}/jnitasks">
<target name="compile" />
<target name="jar" />
<!-- We need to override the src and bin locations. -->
<property name="dir.bin" value="${basedir}/jnitasks/bin" />
<property name="dir.src" value="${basedir}/jnitasks/src" />
<property name="dir.jar" value="${basedir}" />
<!-- Set a few of the configurable properties. -->
<property name="ant.build.debug" value="${ant.build.debug}" />
<property name="ant.build.javac.compiler" value="${ant.build.javac.compiler}" />
<property name="ant.build.javac.source" value="${ant.build.javac.source}" />
<property name="ant.build.javac.target" value="${ant.build.javac.target}" />
<property name="ant.build.javac.args" value="${ant.build.javac.args}" />
</ant>
</target>
and line 76 is 8th line of below code block
<condition property="ant.build.javac.bootclasspath" value="${env.JDK_HOME}/bundle/Classes/classes.jar">
<available file="${env.JDK_HOME}/bundle/Classes/classes.jar" type="dir" />
</condition>
<condition property="ant.build.javac.bootclasspath" value="${env.JAVA_HOME}/bundle/Classes/classes.jar">
<available file="${env.JAVA_HOME}/bundle/Classes/classes.jar" type="dir" />
</condition>
<condition property="ant.build.javac.bootclasspath" value="${java.home}/bundle/Classes/classes.jar">
<available file="${java.home}/bundle/Classes/classes.jar" type="file" />
</condition>
<fail message="Could not determine ant.build.javac.bootclasspath location. Please set your JDK_HOME / JAVA_HOME environment variable or manually set the ant.build.javac.bootclasspath property to the location of your rt.jar file.">
I didn't tried cross.build.xml on mac yet.
I need some help..

You must compile all the native code separately for each platform. You cannot compile for Windows on mac without a cross compiler like msys2. You can compile a set of binaries on each platform using ant compile-native and combine the lib directories before calling ant jar. The cross.build.xml file is used to cross-compile all platforms from linux. Instructions on cross-compiling are also located in the Wiki.
Your Windows 10 build is failing because you are not using the correct shell to compile from. You must use the mingw32/64 shell to run ant. Again, this is all outlined in the Wiki on the project page.

Related

Exception in Install4j when creating an 32 bit Installer with bundled JRE

Using Apache ANT I create a JRE bundle of a 32 bit JRE 1.8.202 using createbundle.exe:
<property name="CREATEBUNDLE" value="${install4j.path}/bin/createbundle.exe" />
<exec executable="${CREATEBUNDLE}">
<arg value="-o" />
<arg value="${install4jJREBundleDir}/${CURRENT_JRE_NAME}/" />
<!-- input -->
<arg value="${unzippedJREDirectory}/${JREDirName}/" />
</exec>
<!-- Get filename of created JRE Bundle -->
<fileset id="contents" dir="${install4jJREBundleDir}/${CURRENT_JRE_NAME}/" includes="*.tar.gz" />
<pathconvert property="INSTALL4J_JREBUNDLE" refid="contents" />
Using this bundle I try to create a 32 bit installer for my application:
<target name="installer.internal">
<install4j projectfile="${i4jprojectfile}" verbose="true" mediatypes="${i4jmediatypes}" destination="${dist}" >
<vmParameter value="-Dinstall4j.timestampUrl=${INSTALL4J_TIMESTAMP_URL}"/>
<variable name="BUILD_VERSION" value="${BUILD_VERSION}" />
<variable name="SOFTWARE_VERSION" value="${SOFTWARE_VERSION}" />
<variable name="PLATFORM_DETAIL_STRING" value="${PLATFORM_DETAIL_STRING}" />
<variable name="INSTALL4J_JREBUNDLE" value="${INSTALL4J_JREBUNDLE}" />
</install4j>
</target>
The following error is thrown when creating the installer:
350 [install4j] com.exe4j.a.d: Cannot bundle a 64-bit JRE with a 32-bit media file.
351 [install4j] at com.install4j.b.g.g.a(ejt:97)
352 [install4j] at com.install4j.b.b.a(ejt:175)
353 [install4j] at com.install4j.b.i$a.c(ejt:846)
354 [install4j] at com.install4j.b.i$a.b(ejt:837)
355 [install4j] at com.install4j.b.i.b(ejt:163)
356 [install4j] at com.install4j.Install4JApplication.c(ejt:479)
357 [install4j] at com.exe4j.a.a(ejt:342)
358 [install4j] at com.install4j.Install4JApplication.main(ejt:94)
359 [install4j] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
360 [install4j] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
361 [install4j] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
362 [install4j] at java.lang.reflect.Method.invoke(Unknown Source)
363 [install4j] at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:85)
364 [install4j] at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
365 [install4j] at com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)
366 [install4j] install4j: compilation failed. Reason: Cannot bundle a 64-bit JRE with a 32-bit media file.
The JRE in the bundle is 32 bit, so the error doesn't really make sense.
Edit: I tried using install4j v7.0.18 and Install4j8.
The architecture is determined from the absolute path of the bundle file. Our bundle file resides in a folder called 'c:\src\Windows10_x64...' Because of the 'x64' in the path ('Windows10_x64') Install4j thought the bundle is 64 bit.
Edit: The solution was to use a relative path for the bundle file omitting the 'Windows10_x64' folder.

Service Builder is giving error with life-ray 7

I'm working on Liferay 7. I'm new to Liferay and I'm experiencing an issue that I spent too much time on.
I have a portlet that I decided to create a Service Builder (named "Employee"). Here is my service.xml :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 7.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_7_0_0.dtd">
<service-builder package-path="com.test">
<author>sachin.singh</author>
<namespace>crud</namespace>
<entity name="Employee" table="user" local-service="true" remote-service="true">
<column name="iduser" type="int" primary="true" id-type="increment"/>
<column name="name" type="String" />
<column name="secret_code" type="String" />
</entity>
</service-builder>
And when i am building using liferay service builder i am getting this error
[copy] Copying 1 file to D:\tools\com.liferay.portal.plugins.sdk-1.0.11\portlets\firstLiferay-portlet\docroot\WEB-INF\classes
[copy] Copied 3 empty directories to 2 empty directories under D:\tools\com.liferay.portal.plugins.sdk-1.0.11\portlets\firstLiferay-portlet\docroot\WEB-INF\classes
[jar] Building MANIFEST-only jar: D:\tools\com.liferay.portal.plugins.sdk-1.0.11\portlets\firstLiferay-portlet\service-builder-classpath.jar
[delete] Deleting: D:\tools\com.liferay.portal.plugins.sdk-1.0.11\portlets\firstLiferay-portlet\service-builder-classpath.jar.manifest
[java] Java Result: 1
[delete] Deleting: D:\tools\com.liferay.portal.plugins.sdk-1.0.11\portlets\firstLiferay-portlet\service-builder-classpath.jar
[echo] java.lang.NoClassDefFoundError: com/thoughtworks/qdox/model/JavaMethod
[echo] at java.lang.Class.getDeclaredMethods0(Native Method)
[echo] at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
[echo] at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
[echo] at java.lang.Class.getMethod0(Class.java:3018)
[echo] at java.lang.Class.getMethod(Class.java:1784)
[echo] at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
[echo] at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
[echo] Caused by: java.lang.ClassNotFoundException: com.thoughtworks.qdox.model.JavaMethod
[echo] at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
[echo] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[echo] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
[echo] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[echo] ... 7 more
[echo] Error: A JNI error has occurred, please check your installation and try again
[echo] Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
[echo] Exception in thread "main"
I checked and cross verify,All jars are there in jar library.
Here is the screenshot of added jar:
Especially when you're new, I'd recommend to try again and use Liferay Workspace instead of the (deprecated) plugins-sdk. All of the samples (here's one for service builder) build on this, and plugins-sdk should largely be used only to migrate existing legacy plugins to the latest release.
I'm not sure what your screenshot shows - if it's all of the bundled jars, then it looks horrible. You should only have tiny plugins in times of OSGi bundles, and it definitely looks like those are way too many dependencies.

JavaFX native bundle exe is throwing "JavaFx launcher Exception" where as Executable Jar file is perfectly running

For long time I was facing an issue while running the application jar -
I am obfuscating the JAR using Proguard and that JAR file also contains some resource files like images, .version file, etc along with publicCerts.store file.
So to include resource file into final JAR I had specified all the resource files as
-adaptresourcefilecontents **.fxml,**.properties,META-INF/MANIFEST.MF,images/*.jar,*.version,publicCerts.store
but while running my application JAR I was getting execption -
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.javafx.main.Main.a(Main.java:642)
at com.javafx.main.Main.main(Main.java:805)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherIm
pl.java:403)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:
47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.AssertionError: java.security.KeyStoreException: Uninitiali
zed keystore
at de.schlichtherle.license.LicenseNotary.getPublicKey(Unknown Source)
at de.schlichtherle.license.LicenseNotary.verify(Unknown Source)
at de.schlichtherle.license.LicenseManager.verify(Unknown Source)
at de.schlichtherle.license.LicenseManager.verify(Unknown Source)
at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:206)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:173)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:29
)
at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:73)
... 1 more
Caused by: java.security.KeyStoreException: Uninitialized keystore
at java.security.KeyStore.isKeyEntry(Unknown Source)
... 17 more
I thought the obfuscation corrupting the publicCerts.store so use another obfuscation option for publicCerts.store
-adaptresourcefilenames publicCerts.store
-adaptresourcefilecontents **.fxml,**.properties,META-INF/MANIFEST.MF,images/*.jar,.version
and it works. When I used to double click on by application jar it is showing my application window but now the native bundle executable (exe) is showing me this dialog in the same case at the same condition.
Edited -
I have debugged the issue and found that it's throwing exception -
java.lang.AssertionError: java.security.NoSuchAlgorithmException: PBEWithMD5AndDES SecretKeyFactory not available java.security.NoSuchAlgorithmException: PBEWithMD5AndDES SecretKeyFactory not available
I wonder the native bundle executable (exe) is made up from the same executable but the exe is not working. Here is ANT step to deploy the application and create the native bundle exe.
<target name="CreatingExe" depends="SignedJar">
<fx:deploy width="800" height="600" nativeBundles="all" outdir="${dist}" outfile="${app.name}">
<fx:info title="${app.title}"/>
<fx:application name="${app.title}" mainClass="${main.class}"/>
<fx:resources>
<fx:fileset dir="${distBI}" includes="*.jar"/>
<fx:fileset dir="${WorkingFolder}/temp"/>
</fx:resources>
</fx:deploy>
</target>
FYI : I am running my build on Windows 8 O.S., 64 bit machine. I am deploying my JavaFX application in following steps-
Compiling JavaFX Code.
Creating JAR.
Obfuscating code.
Signing Jar
Creating Executable.
Signing Executable.
Build was successful.
How to exclude publicCerts.store from obfuscation? Why the final exe is not working even the application jar is working? Do I need to specify any thing else in fx:deploy task?
When building a JavaFx native bundle the ext folder under <JDK.HOME> doesn't get included. What this folder contain is mostly the security stuff.
<!--Copy the ext library to the runtime lib-->
<copydir src="${java.home}/lib/ext"
dest="${dist.jar.dir}/bundles/{YOUR.PACKAGE.NAME}/runtime/jre/lib/ext"
includes="**/*"
/>

Deploying a JavaFX 2 application with referenced jars, using Ant

I have written a JavaFx 2 application (using Eclipse on a Windows platform) and now I want to deploy it to a "clickable" jar-file. My application uses resource-code from a separate jar-file (in Eclipse, this resource code is a separate Project from the JavaFx application project).
With my Ant build.xml, I have compiled the code for both the application and the resource code and created two jar-files:
fxdemo.jar - A jar for my JavaFx application code
guifw.jar - A jar for the resource code referenced by the JavaFx application.
As a last step (I thought), using the JavaFX Ant tasks, I wanted to bundle these two jar-files to a "clickable" jar that starts my JavaFX application. I tried doing just that with the below extract from my build.xml.
<target name="deployFx" depends="fxdemo.jar" description="Releases FxDemo">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath=".:${fxgui.javaHome}\lib\ant-javafx.jar"/>
<copy file="${fxgui.lib_guifw_path}" tofile="delivery/lib/guifw.jar"/>
<fx:application id="FxDemoGUI" name="Fx Demo GUI" MainClass="com.demo.main.MainGUI"/>
<fx:resources id="jars">
<fx:fileset dir="delivery/lib" includes="fxdemo.jar"/>
<fx:fileset dir="delivery/lib" includes="guifw.jar"/>
</fx:resources>
<fx:jar destfile="deploy/fxDemoGui.jar">
<!-- Define what to launch -->
<fx:application refid="FxDemoGUI"/>
<fx:platform javafx="2.1+">
<fx:jvmarg value="-Xms32m"/>
<fx:jvmarg value="-Xmx32m"/>
<property name="com.util.fxguifw.setup" value="com/util/fxguifw/demo/demo.properties"/>
<property name="user.language" value="en"/>
<property name="user.country" value="GB"/>
<property name="CSS_ID" value="NIGHT"/>
</fx:platform>
<fx:resources>
<fx:fileset dir="delivery/lib" includes="fxdemo.jar"/>
<fx:fileset dir="delivery/lib" includes="guifw.jar"/>
</fx:resources>
<manifest>
<attribute name="Implementation-Vendor" value="${fxgui.vendor}"/>
<attribute name="Implementation-Title" value="${fxgui.title}"/>
<attribute name="Implementation-Version" value="1.0"/>
</manifest>
<fileset dir="delivery"/>
</fx:jar>
However, afterwards when I try to start the application (by either clicking the jar or starting from command line with java -jar appname.jar) it seems as the application can not find the Main class:
JavaFX Launcher Error
Unable to find class: com.demo.main.MainGUI
C:\Program Files\Java\jdk1.7.0_09\bin>java -jar C:\MEKMAN\Clearcase_Views\wmarekm_ss_gambau\amb_c2_prototype\javafx\prototypeGUI\deploy\fxDemoGui.jar
java.lang.ClassNotFoundException: com.demo.main.MainGUI
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.javafx.main.Main.getAppClass(Main.java:506)
at com.javafx.main.Main.launchApp(Main.java:622)
at com.javafx.main.Main.main(Main.java:805)
When I studie the created MANIFEST.MF (in the created jar-file) it looks pretty much as what I expected.
Manifest-Version: 1.0
JavaFX-Version: 2.1+
implementation-vendor: MyVendor
implementation-title: MyfirstJavaFxDeploy
implementation-version: 1.0
JavaFX-Application-Class:com.demo.main.MainGUI
JavaFX-Class-Path: fxdemo.jar guifw.jar
Created-By: JavaFXPackager
Main-Class: com/javafx/main/Main
... but then again, it doesn't work so obviously I have done something wrong.
I also tried including the classes-directory (the output folders from each of the two Eclipse/projects) by adding:
<fileset dir="../guifw/classes"/>
<fileset dir="classes"/>
Then, the launcher does find my main class (com.demo.main.MainGUI) but failes to run correctly because it lacks the -D argument that I tried to specify with:
<property name="com.util.fxguifw.setup" value="com/util/fxguifw/demo/demo.properties"/>
So, if you have read this far, my questions are:
Why can't the launcher find my main class in the referenced jar (fxdemo.jar)?
What have I done wrong when it comes to specify my -D arguments to the application?
Best regards
I studied/tested the fix presented in post (2012-apr-12 03:32) in the link from #Anders Petersson:
Link from #Anders Petersson
From what I can see, this is a workaround that unbudles any used jar-file (in my case; guifw.jar & demofx.jar) within the resulting jar file (fxDemoGui.jar), much like adding the classes-folders from my two Eclipse-projects (as described in the question).
I adjusted the example to my build.xml and got it to work after one slight addition:
<target name="dist" depends="fxdemo.jar">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath=".:${fxgui.javaHome}\lib\ant-javafx.jar"/>
<copy file="${fxgui.lib_guifw_path}" tofile="delivery/lib/guifw.jar"/>
<fx:jar destfile="predeploy/fxDemoGui.jar">
<!-- ADDITION -> Adds the Launcher's Main class to the resulting jar (com.javafx.main.Main)! -->
<fx:application id="FxDemoGUI"
name="Fx Demo GUI"
mainClass="com.demo.main.MainGUI"/>
<fileset dir="delivery"/>
</fx:jar>
</target>
In the dist-target from the example, I had to add:
<fx:application id="FxDemoGUI"
name="Fx Demo GUI"
mainClass="com.demo.main.MainGUI"/>
Without it, the resulting jar-file did not have the necessary com.javafx.main.Main-class and hence, failed to start.
So, this solution presents a useful workaround for my question 1)
Still, I'd be grateful if anyone comes up with a solution on how to keep the jar-files intact within the resulting jar/file.

Configuring Scala compiler in IntelliJ 10.5?

I'm trying to get Scala working correctly in IntelliJ 10.5.1. I installed the plugin from the "available plugins" settings and then tried starting a new Java project, selecting "scala" under available technologies. But when I try running it, Scala says I haven't defined a scala compiler in the scala facet. So I went there, but I don't see any way of setting up the compiler. Also, my .iml file in my project looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="scala" name="Scala">
<configuration>
<option name="compilerLibraryLevel" value="Global" />
<option name="pluginPaths">
<array>
<option value="$USER_HOME$/SDKs/scala/src/scala-compiler-src.jar" />
</array>
</option>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="scala " level="application" />
</component>
</module>
Notice that it does seem to be pointing to the correct jar compiler destination.
What do I need to do?
EDIT -
Compiler working now, but when I run, i get this error:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -Didea.launcher.port=7540 -Didea.launcher.bin.path=/Applications/IntelliJ IDEA 10 CE.app/bin -Dfile.encoding=UTF-8 -classpath /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/deploy.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/dt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/javaws.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jce.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/jconsole.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/management-agent.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/plugin.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/sa-jdi.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/alt-rt.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/alt-string.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/charsets.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/classes.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/jsse.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../Classes/ui.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/apple_provider.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/dnsns.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/localedata.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunjce_provider.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/ext/sunpkcs11.jar:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home:/Users/me/Projects/Scala/testing/out/test/testing:/Users/me/Projects/Scala/testing/out/production/testing:/Users/me/SDKs/scala/lib/scala-library.jar:/Users/me/SDKs/scala/lib/scala-swing.jar:/Users/me/SDKs/scala/lib/scala-dbc.jar:/Applications/IntelliJ IDEA 10 CE.app/lib/idea_rt.jar com.intellij.rt.execution.application.AppMain hello_world
Exception in thread "main" java.lang.ClassNotFoundException: hello_world
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)
Process finished with exit code 1
Go to project settings (that could be invoked by Ctrl+Alt+Shift+S) and choose scala-compiler in libraries list just like that:
Now FacetManager component looks like this:
<component name="FacetManager">
<facet type="scala" name="Scala">
<configuration>
<option name="compilerLibraryLevel" value="Global" />
<option name="compilerLibraryName" value="scala-compiler-2.9.0.1" />
</configuration>
</facet>
</component>
See the Project Configuration Guide.
If you use SBT to build, I recommend using sbt-idea to generate your IDEA project, and idea-sbt-plugin to delegate project compilation within IDEA to SBT.
I guess you need to add the scala compiler library to the global libraries. In the module settings-> Global Libraries -> attach jar directories and select the lib folder under scala installation directory and then do as om-nom-nom suggested to make sure the compiler is selected.