Click here to Skip to main content
15,867,141 members
Home / Discussions / Java
   

Java

 
GeneralRe: Socket connection offline vs busy Pin
JohnCodding9-Aug-22 21:10
JohnCodding9-Aug-22 21:10 
GeneralRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:12
mveRichard MacCutchan9-Aug-22 21:12 
GeneralRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:17
mveRichard MacCutchan9-Aug-22 21:17 
GeneralRe: Socket connection offline vs busy Pin
JohnCodding9-Aug-22 21:36
JohnCodding9-Aug-22 21:36 
GeneralRe: Socket connection offline vs busy Pin
Richard MacCutchan9-Aug-22 21:45
mveRichard MacCutchan9-Aug-22 21:45 
AnswerRe: Socket connection offline vs busy Pin
Gerry Schmitz10-Aug-22 4:13
mveGerry Schmitz10-Aug-22 4:13 
AnswerRe: Socket connection offline vs busy Pin
englebart12-Oct-22 15:20
professionalenglebart12-Oct-22 15:20 
QuestionUser Path not working until computer restart Pin
Valentinor13-Jul-22 9:27
Valentinor13-Jul-22 9:27 
In my app I'm using JNI, and because of that I have to add into User/System Path the location to jvm.dll from JRE\bin\server. To add a variable in User Path it doesn't require administrator rights, so I'm taking this approach. To add it I'm using REG ADD from CMD with the following functions. The problem that I have is that after I'm adding the variable into Path, the software still doesn't see it and returns the error "jvm.dll not found", but if I restart the computer, then it runs fine and sees the variable. Also after I'm adding it, if I manually go into User Path and double click to edit the variable, and simply press enter without changing anything, then it doesn't require the restart. Does it have something to do with the code/way I'm adding the variable? What should I do to get past this and to get it working without the user/client having to restart the computer before it is working?

Function to run CMD:
C++
std::string executeCMD(const char* cmd) {
	std::string result;
	std::array<char, 128> buffer;
	std::unique_ptr<FILE, decltype(&_pclose)> pipe(_popen(cmd, "r"), _pclose);
	if (!pipe) {
		return "ErrorCMD";
	}
	while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
		result += buffer.data();
	}
	return result;
}


Use of the function:
C++
resultCMD.insert(0, "reg add \"HKEY_CURRENT_USER\\Environment\" /v PATH /t REG_EXPAND_SZ /d \"");
resultCMD.append("\" /f");
executeCMD(resultCMD.c_str());


resultCMD is a std::string which contains the values that were in Path and also the value that I'm adding under the following format with "C:\Program Files\Eclipse Adoptium\jre-18.0.1.10-hotspot\bin\server" being added after I use the function from above:
C:\Program Files\Eclipse Adoptium\jre-18.0.1.10-hotspot\bin\server;D:\Program Files (x86)\VMware\VMware Player\bin\;D:\Program Files\Python\Python310\Scripts\;D:\Program Files\Python\Python310\;C:\Windows\system32;C:\Windows; ...and the rest of the variables, this was as an example, after each variable they have a ;
AnswerRe: User Path not working until computer restart Pin
Valentinor13-Jul-22 23:28
Valentinor13-Jul-22 23:28 
AnswerRe: User Path not working until computer restart Pin
englebart12-Oct-22 15:26
professionalenglebart12-Oct-22 15:26 
QuestionDistribute software that uses Java Pin
Valentinor7-Jul-22 9:28
Valentinor7-Jul-22 9:28 
AnswerRe: Distribute software that uses Java Pin
Gerry Schmitz7-Jul-22 19:46
mveGerry Schmitz7-Jul-22 19:46 
AnswerRe: Distribute software that uses Java Pin
Dave Kreskowiak8-Jul-22 11:30
mveDave Kreskowiak8-Jul-22 11:30 
GeneralRe: Distribute software that uses Java Pin
Valentinor8-Jul-22 19:32
Valentinor8-Jul-22 19:32 
GeneralRe: Distribute software that uses Java Pin
Dave Kreskowiak8-Jul-22 19:40
mveDave Kreskowiak8-Jul-22 19:40 
GeneralRe: Distribute software that uses Java Pin
Valentinor8-Jul-22 21:51
Valentinor8-Jul-22 21:51 
GeneralRe: Distribute software that uses Java Pin
Dave Kreskowiak9-Jul-22 5:43
mveDave Kreskowiak9-Jul-22 5:43 
Questionsolve the error Pin
Member 156672428-Jun-22 21:02
Member 156672428-Jun-22 21:02 
RantRe: solve the error Pin
Richard Deeming8-Jun-22 21:19
mveRichard Deeming8-Jun-22 21:19 
AnswerRe: solve the error Pin
Richard MacCutchan8-Jun-22 22:56
mveRichard MacCutchan8-Jun-22 22:56 
AnswerRe: solve the error Pin
Sakshi Jain 202226-Jun-22 20:59
Sakshi Jain 202226-Jun-22 20:59 
GeneralRe: solve the error Pin
Richard MacCutchan26-Jun-22 21:41
mveRichard MacCutchan26-Jun-22 21:41 
GeneralRe: solve the error Pin
Peter_in_278026-Jun-22 22:19
professionalPeter_in_278026-Jun-22 22:19 
QuestionRunnable as a new object? Pin
Member 156629325-Jun-22 13:24
Member 156629325-Jun-22 13:24 
AnswerRe: Runnable as a new object? Pin
Richard MacCutchan5-Jun-22 21:27
mveRichard MacCutchan5-Jun-22 21:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.