Get OpenJDK to work with Packr - osx-yosemite

Using the JSON config, I specify an opendjk prebuild, containing a JRE. (The exact one specified in packr's example in the readme, actually)
It packs my JAR into a mac executable successfully.
I run the executable, and it works as expected on my Yosemite (where I also have Oracle JDK installed)
When I run the executable on another mac with Yosemite (which does not have any JDK installed), it throws java/lang/NoClassDefFoundError: java/lang/Object
But it should use the JRE specified and packed with the executable by packr. It Should not depend on the system to have a JDK installed.
EDIT: Added config.json code -
{
"platform": "mac",
"jdk": "/Users/absolute/path/to/jdk/openjdk-1.7.0-u45-unofficial-icedtea-2.4.3-macosx-x86_64-image.zip",
"executable": "myApp",
"appjar": "/Users/absolute/path/to/jar/MyJar.jar",
"mainclass": "self/edu/Main",
"vmargs": [
"-Xmx256M"
],
"resources": [
],
"minimizejre": "soft",
"outdir": "out-mac"
}

Related

Lauching dotnet fails ("dotnet" is not a file of a symlink)

The default vscode configuration for debugging ASP.NET core contains the following:
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
...
The preLaunchTask fails for me with the following error:
The terminal process failed to launch: Path to shell executable "dotnet" is not a file of a symlink.
I have had this problem before, not on the preLaunchTask but on the main program execution. That I could work around by doing a replace all "dotnet" -> "/usr/bin/dotnet" in ~/.vscode/extensions/ms-dotnettools.csharp-1.**.*/dist/extensions.js + a vscode restart. However, this workaround doesn't work for the preLaunchTask. (And having to do this for every update of that extension in annoying).
Given that I'm a linux noob, it's probably not omnisharp/vscode related but could be something I did wrong in Ubuntu 18.04.
Does anybody know what the error means, and how to fix it? Or even how to debug this problem?
I've already reinstalled vscode, .net5, and my global $PATH env does contain /home/<username>/.dotnet/tools:/usr/bin/dotnet. Other than that I don't know what to do.
in tasks.json file change from
"type": "process" to "type": "shell"

package.json specifying a version for a library

We have following requirements in our package.json,
"three-orbitcontrols": "^2.102.2"
in one computer, node_modules/three-orbigcontrols/package.json has
"_from": "three-orbitcontrols#2.102.2",
"_id": "three-orbitcontrols#2.102.2",
in another computer,
"_from": "three-orbitcontrols#2.102.2",
"_id": "three-orbitcontrols#2.110.1",
So specifying ^2.102.2 doesn't force the version (2.110.1 is installed`
What's the correct way of specifying specific 2.102.2 ?

error: no browser selected to run against, but i mentioned it in .testcafe.json

I have created .testcaferc.json, I mentioned the browser and src in it. so I should be able to run tests without putting this in the command line.
But it does not seem to be reading my config file from the project folder.
{
"src": "c:/Testcafe/Login.js",
"browsers": "firefox",
"reporter": {
"name": "html",
"output": "reports/report.html"
},
"takeScreenshotsOnFails": true,
"screenshotPath": "/screenshots/"
}
Actual:
Using locally installed version of TestCafe.
ERROR No browser selected to test against.
Type "testcafe -h" for help.
Expected:
I should not ask for browser and test file parameter as both are provided in config file.
The configuration file is a feature added in v1.0.0. If you upgrade from 0.20.5 to 1.0.0 or later, you will be able to use the configuration file for your tests.
Release Notes:
https://github.com/DevExpress/testcafe/releases/tag/v1.0.0

JHipster app does not work under prod mode

I have a monolith application that under dev mode everything works ok. When I package the application for production the front-end does not work.
The back end runs ok.
Do you have any suggestions/advices how to debug this?
I have cleaned and reinstalled the node_modules and the yarn.lock file.
No difference.
Any advice would be really appreciated.
Using JHipster version installed locally in current project's node_modules Executing jhipster:info Options: Welcome to the JHipster Information Sub-Generator
##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
<details> <summary>.yo-rc.json file</summary> <pre> { "generator-jhipster": {
"promptValues": {
"packageName": "---"
},
"jhipsterVersion": "4.14.0",
"baseName": "devkit",
"packageName": "---",
"packageFolder": "---",
"serverPort": "8080",
"authenticationType": "jwt",
"cacheProvider": "no",
"websocket": false,
"databaseType": "sql",
"devDatabaseType": "mssql",
"prodDatabaseType": "mssql",
"searchEngine": false,
"messageBroker": false,
"serviceDiscoveryType": false,
"buildTool": "maven",
"enableSocialSignIn": false,
"enableSwaggerCodegen": false,
"jwtSecretKey": "replaced-by-jhipster-info",
"clientFramework": "angularX",
"useSass": false,
"clientPackageManager": "yarn",
"applicationType": "monolith",
"testFrameworks": [],
"jhiPrefix": "jhi",
"enableTranslation": false } } </pre> </details>
##### **Environment and Tools**
java version "1.8.0_161" Java(TM) SE Runtime Environment (build
1.8.0_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode)
git version 2.15.0.windows.1
node: v8.9.4
npm: 5.6.0
yeoman: 2.0.1
yarn: 1.3.2
Docker version 18.03.0-ce, build 0520e24
docker-compose version 1.20.1, build 5d8c71b2
Congratulations, JHipster execution is complete!
Trying to produce a jar instead of a war archive broke the application under prod mode. Changing the filename of the archive that will be produced is easy by simply including the <fileName> tag under the build tag but if you want to change the extensions then do not change the <packaging> tag since this will break the app under production.
UPDATE:
I found that simply renaming the file from war to jar by hand (manually) breaks the front end with the previous described error.

Is VSC not compatible with .net core 2 projects?

Environment: Ubuntu 16.04, .NET Core SDK Preview 2.0.0 (006497), VSC 1.14.2
Things used to work fine under .net core 1. Now, I have upgraded my system to .net core 2.
From the command line, I created a new project and ran it:
$ dotnet new mvc
$ dotnet run
The webpage works as expected.
Now, I open the folder in VSC and tried to debug the app. First time, VCS helps create launch.json and tasks.json. Here is my tasks.json contents:
"version": "2.0.0",
"tasks": [
{
"taskName": "build",
"command": "dotnet",
"type": "shell",
"group": "build",
"presentation": {
"reveal": "silent"
},
"problemMatcher": "$msCompile"
}
]
}
In the terminal view, I see that VCS tries to run the build command as dotnet <. This throws an error that preLaunchTask "build" exited with error code 129.
I tried to fix this by adding args: ["build"] to the task. This seems to fix the build but I now get another error about launch.json not being configured properly.
Wondering if there is some step that I simply missed. Regards.
The answer was provided by mvermef in his comment. I am just adding a new post here so I can mark it as an answer.
The problems with VSC are explained at https://github.com/dotnet/core/blob/master/release-notes/2.0/2.0.0-preview2-known-issues.md. The most important thing is that you remove your existing C# extension and replace it with the latest beta version. Now, if you create a new project from the command line and load it in VSC, you should be able to debug it.