install4j 6.1.6: "Replacement script for language code" doesn't work on MacOS - install4j

We use install4j for our software and we have different languages for our application and for installer too. We are migrating from install4j 5.1.3 to install4j 6.1.6 . During check of installers we've found that "Replacement script for language code" doesn't work on MacOS. For verification I've just built simple installer that returns just "en" in the replacement script. Manual says that Language Selection Dialog should't be shown it that case, but on MacOS it is shown.
With log output there is ClassNotFoundException:
[ERROR] java.lang.ClassNotFoundException: com.install4j.script.I4jScript_Internal_7
java.lang.ClassNotFoundException: com.install4j.script.I4jScript_Internal_7
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at com.install4j.runtime.installer.helper.Install4jClassLoader.loadClass(Install4jClassLoader.java:81)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.install4j.runtime.installer.ContextImpl.runScript(ContextImpl.java:187)
at com.install4j.runtime.installer.ContextImpl.runScript(ContextImpl.java:182)
at com.install4j.runtime.installer.controller.LanguageSelector.initLanguage(LanguageSelector.java:45)
at com.install4j.runtime.installer.controller.Controller.start(Controller.java:60)
at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:59)
at com.install4j.runtime.installer.Installer.main(Installer.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
at com.install4j.runtime.launcher.MacLauncher.main(MacLauncher.java:67)
However, the I4jScript_Internal_7 class is contained in user.jar in archive and it is our script, but for some reason install4j couldn't load it.

This is a bug that will be fixed in 7.0.5.

Related

Not being able to launch exported 64bit product when exporting to multiple platforms

I have followed the current steps to export my product for multiple platforms (namely, following the steps in the preferred way of doing multi-platform builds). However, when I export the product to multiple platforms (for the moment win32.x86 & win32.x86_64) only the x86 version starts correctly. The 64bit version throws the following error:
!MESSAGE An error occurred while automatically activating bundle org.eclipse.ui.workbench (97).
!STACK 0
org.osgi.framework.BundleException: Error starting module.
at org.eclipse.osgi.container.Module.doStart(Module.java:590)
at org.eclipse.osgi.container.Module.start(Module.java:449)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:114)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:505)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:392)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:470)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:762)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:716)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1002)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:354)
at org.eclipse.osgi.container.Module.doStart(Module.java:581)
at org.eclipse.osgi.container.Module.start(Module.java:449)
at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:468)
at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:114)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:505)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:328)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:392)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:470)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:609)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:177)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:931)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:60)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:191)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:656)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:592)
at org.eclipse.equinox.launcher.Main.run(Main.java:1498)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/swt/SWTError
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at org.eclipse.osgi.internal.framework.BundleContextImpl.loadBundleActivator(BundleContextImpl.java:763)
at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:716)
at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:1002)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:354)
at org.eclipse.osgi.container.Module.doStart(Module.java:581)
... 42 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.swt.SWTError cannot be found by org.eclipse.ui.workbench_3.111.0.v20180524-1156
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:508)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:419)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:411)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 51 more
I assume that it is caused by the x86_64 swt plugin not being loaded, however while org.eclipse.swt.win32.win32.x86 plugin is included in the contents of the product definition, when trying to add the x86_64 plugin into the contents of my product, it doesn't appear on the plugin selection dialog (and of course is not already in the list of plugins).
The only thing remotely related to a x86_64 plugin available is the org.eclipse.equinox.launcher.win32.win32.x86_64, but including this and exporting again (unsurprisingly) returns the same error.
I've checked that the target platform has been updated with the software site from 4.8 files, only a few warnings appear.
How can I force the org.eclipse.swt.win32.win32.x86_64 plugin to appear in the available plugins to be selected in my product? I there any additional step to allow multiple platform export?
when you input "Work With",you can not only "replace 4.8 with your version".you must browse this url,(my version is 4.13)
https://download.eclipse.org/eclipse/downloads/drops4/S-4.13M1-201907111805/
and find "Eclipse p2 Repository",now you find true url to "Work With"
it is very importen that You must find the release notes for it.
like this
https://download.eclipse.org/eclipse/downloads/
Finally made it to work. My target platform was corrupted somehow. Creating a new target platform and following the wiki steps worked this time.
The steps are:
Open Window/Preferences.
Find PDE/Target Platform
Select your (active) target platform
Click Edit
Click Add
Select "Software Site"
Click Next
In "Work With" type: http://download.eclipse.org/eclipse/updates/4.8 (replace 4.8 with your version)
Check "Eclipse RCP Target Components"
Check "Equinox Target Components"
Uncheck "Include required software"
Check "Include all environments"
Press Finish
Press Finish
Press OK

Importing Eclipse JUnit tests in IntelliJ idea 2016.1

I'm currently having trouble running Junit tests created in Eclipse on IntelliJ.
My IntelliJ SDK is 1.8, the SDK of the project is 1.7, however, I'm not using any new features.
I've imported the project (properly, I hope) and the JUnit test along with the JDK is being shown in the "External Libraries" tab.
When I run my test I get an "initializationError", and when right clicking the "tests" directory and selecting "Run 'All Tests'" I get the error "No tests were found".
These are the Errors I get:
Exception in thread "main" java.lang.NoClassDefFoundError: org/hamcrest/SelfDescribing
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.junit4.JUnit46ClassesRequestBuilder.getClassesRequest(JUnit46ClassesRequestBuilder.java:50)
at com.intellij.junit4.JUnit4TestRunnerUtil.buildRequest(JUnit4TestRunnerUtil.java:91)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:95)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:234)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
Caused by: java.lang.ClassNotFoundException: org.hamcrest.SelfDescribing
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 25 more
Is there anything I can do?
You need the library hamcrest-core-1.3 on your class-path. See Getting Started

Copied IntelliJ project machine A to B, but it won't build on B

I have IntelliJ, Scala and SBT at work (Win8) and on my laptop (OSX). I've never had a problem like this before. I'm stuck in a hotel because of weather, and I have a copy of my IDEA project on my laptop. I tried building the project on my laptop, and it failed with the message below. As far as I know I have all the dependent JARs, the latest plugins, etc. I don't think I'm missing anything. But I'm mystified how something so simple could eat up time that could be spent programming while I try to figure out what went wrong after zipping and copying an IntelliJ project from one machine to another.
Error:scalac: Error: xsbt.CompilerInterface
java.lang.ClassNotFoundException: xsbt.CompilerInterface
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 java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at sbt.compiler.AnalyzingCompiler.getInterfaceClass(AnalyzingCompiler.scala:117)
at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:99)
at sbt.compiler.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:57)
at sbt.compiler.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:52)
at sbt.compiler.CompilerCache$$anon$2.apply(CompilerCache.scala:50)
at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:39)
at org.jetbrains.jps.incremental.scala.local.IdeaIncrementalCompiler.compile(IdeaIncrementalCompiler.scala:29)
at org.jetbrains.jps.incremental.scala.local.LocalServer.compile(LocalServer.scala:26)
at org.jetbrains.jps.incremental.scala.remote.Main$.make(Main.scala:62)
at org.jetbrains.jps.incremental.scala.remote.Main$.nailMain(Main.scala:20)
at org.jetbrains.jps.incremental.scala.remote.Main.nailMain(Main.scala)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.martiansoftware.nailgun.NGSession.run(NGSession.java:319)
Suggestions:
use "Import project" instead of File|Open. Select sbt project
ensure you have access to internet
build the project first on the command line . e.g
sbt compile package
or
sbt compile assembly
- rebuild the project in the IDE (Yes painful, but it is a known bug)
Get back here if you still encounter issues.
It seems the problem with updating IDEA to version 14. Try removing the JDK from IDEA and adding it again. It should work.

Google App Engine Project Error

I installed the google app engine sdk and plugin and every time I'm trying to save a java file my IDE (Eclipse Kepler) shows me an error window: "Java Virtual Machine Launcher - Could not find the main class com.google.appengine.tools.enhancer.Enhance. Program will exit".
In the console there is also a message:
"java.lang.UnsupportedClassVersionError: com/google/appengine/tools/enhancer/Enhance : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
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)
Exception in thread "main"
It happens only in GAP and GWT projects...simple web or java projects are fine.
How can I fix it?
Thanks.

Exception thrown while running JUnit tests using maven

I got the following exception while running JUnit tests in Maven.
java.lang.IllegalStateException: Native library for Attach API not available in this JRE
at mockit.internal.startup.JDK6AgentLoader.getVirtualMachineImplementationFromEmbeddedOnes(JDK6AgentLoader.java:81)
at mockit.internal.startup.JDK6AgentLoader.loadAgent(JDK6AgentLoader.java:54)
at mockit.internal.startup.AgentInitialization.initializeAccordingToJDKVersion(AgentInitialization.java:21)
at mockit.internal.startup.Startup.initializeIfNeeded(Startup.java:96)
at mockit.integration.junit4.JMockit.<clinit>(JMockit.java:23)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:24)
at org.apache.maven.surefire.junit4.JUnit4TestSet.<init>(JUnit4TestSet.java:45)
at org.apache.maven.surefire.junit4.JUnit4DirectoryTestSuite.createTestSet(JUnit4DirectoryTestSuite.java:56)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.locateTestSets(AbstractDirectoryTestSuite.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.maven.surefire.booter.SurefireBooter.getTestSets(SurefireBooter.java:455)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesForkPerTestSet(SurefireBooter.java:406)
at org.apache.maven.surefire.booter.SurefireBooter.run(SurefireBooter.java:249)
at org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:537)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.UnsatisfiedLinkError: Native Library C:\Program Files\Java\jdk1.6.0_25\jre\bin\attach.dll already loaded in another classloader
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1772)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at sun.tools.attach.WindowsVirtualMachine.<clinit>(WindowsVirtualMachine.java:169)
at mockit.internal.startup.JDK6AgentLoader.getVirtualMachineImplementationFromEmbeddedOnes(JDK6AgentLoader.java:68)
... 44 more
I have used mocking in my tests.The framework used is JMockit. Any help is appreciated.
I don't know why this duplicate loading of "attach.dll" occurs (will investigate later), but you can avoid the problem by using the "-javaagent" JVM initialization parameter. See here for details.
I'll give it a try. Here it says something like:
Caused by: java.lang.UnsatisfiedLinkError: Native Library C:\Program Files\Java\jdk1.6.0_25\jre\bin\attach.dll already loaded in another classloader
My guess is that you try to load the dll twice? Once maybe it's loaded as a maven dependency and once as from the jdk?
Try adding tools.jar to your classpath. If you've downloaded a JDK, it is typically in Contents/Home/lib/tools.jar under your JDK root. If you're using Eclipse, check out this answer on another question.